Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to add values to servlet and call that servlet

 
maheshm morem
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i want to add some parameters to the servlet and calll it from jsp page , so how could we do it?
 
Ankit Garg
Sheriff
Posts: 9497
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can generate a link to your servlet, like if the servlet is mapped to /myRequest, then you can add a code like

<a href="myRequest?param1=value¶m2=value">click here<a>

the two parameters that we've added after the ? mark can be retrieved from the servlet using request.getParameter

(I've ignored the context path to keep the example simple, the proper path to the servlet would be ${pageContext.request.contextPath}/myRequest )
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64186
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or, submit a form.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic