aspose file tools*
The moose likes Struts and the fly likes Struts 2 global result 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 "Struts 2 global result" Watch "Struts 2 global result" New topic
Author

Struts 2 global result

Kim Long
Greenhorn

Joined: Jun 06, 2008
Posts: 9
i have kinda often the same result page for diffrent actions is it possible to define the result somehow global and just make a reference to it? Would be nice if someone could help me out.

thanks

kim
Pavan Naidu
Greenhorn

Joined: Jun 10, 2008
Posts: 2
Originally posted by Kim Long:
i have kinda often the same result page for diffrent actions is it possible to define the result somehow global and just make a reference to it? Would be nice if someone could help me out.

thanks

kim

When ever there is a scenario that you have to forward to a single jsp from multiple action classes you have to use global forwars instead of localforwards.
Henrik Samuelsson
Greenhorn

Joined: Jun 10, 2008
Posts: 6
Add this in your struts.xml

<global-results>
<result name="yourName">yourJSP.jsp</result>
</global-results>

And let all the action that have the same result return the same String. In this case "yourName".
Kim Long
Greenhorn

Joined: Jun 06, 2008
Posts: 9
Thanks i will try this tommorrow.
 
 
subject: Struts 2 global result