Solved

Calling a method

Posted on 2004-04-05
3
176 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can't get intermediate Certificate to work in Tomcat 9 113
report generation frameworks 1 60
dateFashion java challenge 9 132
equalIsNot  challenge 43 134
What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
With the rapid rise in mobile usage, mobile devices are here to stay and have become an integral part of doing business. Here are 9 great apps for your BYOD environment.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now