File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Missing request parameters after servlet chaining 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 "Missing request parameters after servlet chaining" Watch "Missing request parameters after servlet chaining" New topic

Missing request parameters after servlet chaining

steward frank

Joined: Mar 22, 2004
Posts: 20
Hi there,
I am currently using struts and am using action chaining, however i realize that when a request comes in with parameters , the corrresponding action class gets activated and then it forwards to another action class , then that action class forwards to a jsp page, now the thing is when it reaches the jsp page, the request parameters mysteriously goes missing, i got a null, but i am able to retrieve those parameters in the first action class. am i missing something here? or is this an inherent problem in struts? is so, how do i work around it? putting the request parameters as attributes seem like an ugly workaround, can someone enlighten me? Thanks!!

Best Regards
John Carnell
Ranch Hand

Joined: Sep 27, 2002
Posts: 71
Hi Steward,

How are you "forwarding" the request? In the action class are you forwarding to the next action by using actionMapping.findForward(...) in the execute() method of the Action class you are forwarding from.


John Carnell<br />Principal Architect<br /> <br />Netchange, LLC<br />1161 HillCrest Heights<br />Green Bay, WI 54313<br /> <br /><br /> <br /> <br />Author of <a href="" target="_blank" rel="nofollow">Pro Jakarta Struts, Second Edition</a>
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
In action ,
class you can keep your request parameter with request/session/application like this:

request.setAttribute("some parameter", request.getParameter("some parameter"));


request.getSession().setAttribute("some parameter", request.getParameter("some parameter"));

And in jsp page

you can get data in request/session like this :

request.getAttribute("some parameter");


session.getAttribute("some parameter");

Java Developer, Thailand
steward frank

Joined: Mar 22, 2004
Posts: 20
Hello John Carnell,
Yes, thats what i am doing, hey!, how do you know? oh yeah of course you do , you wrote the book!! hehe, so is this a known issue? how can i solve this problem? Many thanks!!!

Best Regards
Don't get me started about those stupid light bulbs.
subject: Missing request parameters after servlet chaining
Similar Threads
Missing request parameters after action chaining
dynamic forward to different pages from ActionClass
html:link Submitting form
doubt in page scope
Struts Question about global forwards and action mapping