Solved

Calling a method

Posted on 2004-04-05
3
175 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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 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

12 Experts available now in Live!

Get 1:1 Help Now