This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes struts.xml action tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts.xml action tag" Watch "struts.xml action tag" New topic
Author

struts.xml action tag

praveen madoori
Greenhorn

Joined: Apr 04, 2008
Posts: 2
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
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8707
    
    6

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
praveen madoori
Greenhorn

Joined: Apr 04, 2008
Posts: 2
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts.xml action tag
 
Similar Threads
struts2: howto correctly deligate actions on the struts.xml's include files
But this code, throws the exception "The Struts dispatcher cannot be found".
struts2s token-session interceptor
Can't enter in a jsp.
struts-config.xml