This week's giveaway is in the Java in General forum.
We're giving away four copies of Java Challengers and have Rafael del Nero on-line!
See this thread for details.
Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Missing request parameters after servlet chaining

 
steward frank
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Author
Posts: 93
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thanks,
John
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In action ,
class you can keep your request parameter with request/session/application like this:

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

or

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");

or

session.getAttribute("some parameter");


 
steward frank
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic