Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 global result

 
Kim Long
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks i will try this tommorrow.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic