Solved

Calling a method

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with Pie chart in Jsp 20 215
Is possible to make a jsp script work with oracle wallet? 7 102
How to set default webapp for host 6 46
login jsp example 24 51
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

832 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