wood burning stoves 2.0*
The moose likes Struts and the fly likes Adding request parameters to a forward from a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Adding request parameters to a forward from a servlet" Watch "Adding request parameters to a forward from a servlet" New topic
Author

Adding request parameters to a forward from a servlet

Paul Duer
Ranch Hand

Joined: Oct 10, 2002
Posts: 98
Hi guys,
This one just might be a brain drain, but I am having trouble with my servlet to Struts knowledge.
I have a Struts app that starts at a certain .do action. I usally have a first JSP page that gets into the app and it uses the forms and action classes from there.
But i have a case now were I am in a servlet and I want to forward directly to the Struts app and call the first .do action. But, I want to put some new request parameters that I got in the servlet on the request.
So what statement in the servlet can add parameters to the request object?
Ruud Steeghs
Ranch Hand

Joined: Jul 09, 2001
Posts: 56
the only way to add parameters to a request in code is to put them in the query string...
that means you have to obtain a request dispatcher and forward to youraction.do?par1=value1&par2=value2
Ruud.
 
Consider Paul's rocket mass heater.
 
subject: Adding request parameters to a forward from a servlet
 
Similar Threads
Call servlet from action class
Missing request parameters after action chaining
dynamic forward to different pages from ActionClass
Forcing a BatchUpdateException
Redirecting from one action to another, want to pass parameters