• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts.xml action tag

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is from struts2mailreader example.
Can some one explain me what does the following 2 lines do.

<result name="cancel" type="redirect-action">Welcome</result>
<result type="redirect-action">MainMenu</result>

My understanding was when you specify an type for the result name then the server takes that action.
But when you have 2 type's what does this infer.
I am trying to resolve this but not successful.

fyi this is the whole action tag

<action name="Login_*" method="{1}" class="mailreader2.Login">
<result name="input">/Login.jsp</result>
<result name="cancel" type="redirect-action">Welcome</result>
<result type="redirect-action">MainMenu</result>
<result name="expired" type="chain">ChangePassword</result>
<exception-mapping
exception="org.apache.struts.apps.mailreader.dao.ExpiredPasswordException"
result="expired"/>
<interceptor-ref name="guest"/>
</action>

thanks in advance
praveen
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the Walking Tour of the Struts MailReader Application:

The third result has no name, so it will be called if the default success token is returned. So, if the Login succeeds, control will transfer to the MainMenu action.

 
praveen madoori
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Joe !
That was an easy reply.
As I was wondering in the forest in search for solution,
simple basic one I missed it.
Thanks again for your quick response.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic