Solved

Calling a method

Posted on 2004-04-05
3
180 Views
Last Modified: 2010-04-01
Here is a subquestion to a post I made earlier:

given integers x and y, what is the syntax to send them to a servlet called Logic.java to its method doGet(), using the command in a jsp page, onChange( )?  The onChange command is embedded in each of a series of dynamic dropdowns in the select tag in the jsp page, populated by a for loop.  The method doGet( ) will contain a query that will check the logic of the dropdowns to determine population.  Please use laments terms as much as possible, my javascript and servlet skills are lacking. ;)  Thanks!
0
Comment
Question by:gdlp2004
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

by:
kennethxu earned 250 total points
ID: 10761607
when you use onChange(), you are using javascript. so you must use javascript to either 1) send the parameter via url or 2) post the form to servlet.

but as you indicate you one doGet in server (while i don't know why because you can easily make servlet access doPost ), you can only use option 1.

you should call this in your javascript:
var x=123;
var y=456;
location.replace( 'urltoyoursevlet?x=' + x + '&y=' + y );

0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Export JSON response data to Excel in IE9 3 96
IE doesn't Invoke servlet in iframe 1 128
oracle fusion vs MQ 2 134
How can I   ajax html table  rows? 20 88
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Check out this step-by-step guide for asking an anonymous question on Experts Exchange.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question