Solved

Calling a method

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

While it may be true that the internet is a place of possibilities, it is also a hostile environment lurking with many dangers. By clicking on the wrong link, trusting the wrong person or using a weak password, you are virtually inviting hackers to …
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

735 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