• Post Reply Bookmark Topic Watch Topic
  • New Topic

passing values from JSP to servet  RSS feed

 
Rahul Ashar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a situation as follows

The JSP page (say First.jsp)displays a radiobutton array to select from

I have 3 links/button (not the usual submit button) on First.jsp
l1,l2,l3 . I want to send 1 parameter from the First.jsp to Servlet if l1 is clicked and 2 parameters if l2 or l3 is clicked.

Is this is possible?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can put whatever request parameters you like in the query strings of the link URLs.
 
vaibhav maddiwar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its absolutly possible. Just append the data you want to send with query string.
Here is the systax.



But it won't forward the existing request to the servlet. For doing so take a look at <jsp:forward....
[ September 19, 2008: Message edited by: vaibhav maddiwar ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you forward to the servlet?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!