Sending request parameter on click of link is easy, like this way:
Here, we can get key1 and key2 at second.jsp from request paramaeters.
But how to send request parameter on click of button??
Hope my question is clear.
Please suggest me..
Thanks a lot. [ December 24, 2005: Message edited by: Bear Bibeault ]
posted 11 years ago
This is really an (X)HTML question. I assume the button you refer to is like a 'submit' button on a form. In which case, you must first create the HTML form (or XForms if you are using a browser which supports that). You can either add parameters which have fixed values, or form controls which accept user input and produce parameters.
This creates a button with label 'buttonname' which submits the form (sends a new request to the server) containing the fixed (predetermined) parameters 'key1' and 'key2'.
You can also get user input, for example from a text field:
Now a single-line text field will appear; the string entered will be the value submitted to second.jsp for the parameter with name 'key1'.
You could also choose the form method of GET (rather than POST), if you want the parameters to appear in the user's URL (for bookmarking purposes for instance).
If that doesn't help, or doesn't answer your question, please post a more specific question and I'll take another look. [ December 24, 2005: Message edited by: Charles Lyons ]
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / AmazonAmazon UK )
Onion rings are vegetable donuts. Taste this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads