wood burning stoves*
The moose likes Servlets and the fly likes Passing attributes via a jsp form to a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Passing attributes via a jsp form to a servlet" Watch "Passing attributes via a jsp form to a servlet" New topic
Author

Passing attributes via a jsp form to a servlet

David Tighe
Greenhorn

Joined: Aug 31, 2001
Posts: 2
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

Joined: Mar 25, 2001
Posts: 33
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

Joined: Aug 31, 2001
Posts: 2
Thanks for your help Dmitriy, appreciate it, helped a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing attributes via a jsp form to a servlet