This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 9345
    
    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: 9345
    
    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
 
Similar Threads
populate items using struts2 <s:select>
struts2 properties file reload
Accessing param in Struts.xml Action Mapping
Url does not have the querystring on using the <s: tags in struts2
> expected error in JSP (struts 2)