aspose file tools*
The moose likes Struts and the fly likes Setting and getting request attributes across action calls Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Setting and getting request attributes across action calls" Watch "Setting and getting request attributes across action calls" New topic
Author

Setting and getting request attributes across action calls

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9427
    
    2

I have the following snippet in one of my jsp:



On click of the url, I'm calling an action as is evident from the code above. in my action class, I want to decide on redirection based on the myName attribute. But it evaluates to null when I get this attribute in my action class called by the url. Am I doing anything wrong? I guess yes.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9427
    
    2

My understanding is that the request object used when the jsp page is being rendered is gone and when I click the url, a new request object gets generated and this guy does not have the attribute set. The goal here is, I'm going to use this attribute's value to control redirection from my action class. All I want here is to ship a request parameter or a request attribute (which is visible in the rendering jsp) to the action and based on the value, redirect the action accordingly.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting and getting request attributes across action calls