Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing attributes via a jsp form to a servlet

 
David Tighe
Greenhorn
Posts: 2
  • 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
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help Dmitriy, appreciate it, helped a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic