File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing attributes via a jsp form to a servlet

 
David Tighe
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I'm looking to pass an object via a form from a jsp to a servlet.
I can do this without the form by using
<% request.setAttribute("Object", testObject);
request.getRequestDispatcher"../servlet/GetObject").forward (request, response);
%>
Does anyone know of a way I can link this type of code into the submit button of a form in a jsp page?
Thanks in advance,
Dave
 
Dmitriy Pavlyuk
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cann't send "attribute" in request by submit button of html form. You can send only "parameters".
The way to solve your problem - it is send nessasary "parameters" to one servlet in which you set given parameters to request "attribute" and forward to your main servlet.
Dmitriy.
 
David Tighe
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help Dmitriy, appreciate it, helped a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic