You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by quinquin2209 <qu...@yahoo.com.hk> on 2008/01/25 08:30:38 UTC

Action method is not called when the page is redirected with actionError

Hi All,

I have the following 2 actions defined:

<action name="list" class="mainAction" method="initDisplay">
    	<interceptor-ref name="store">
	      RETRIEVE
	</interceptor-ref>
	<interceptor-ref name="defaultStack" />
	<result name="input">/jsp/main.jsp</result>
</action>
<action name="addMember" class="mainAction" method="addMember">
       	<interceptor-ref name="store">
	      STORE
	</interceptor-ref>
        <interceptor-ref name="defaultStack" />
        <result name="success" type="redirect">list.action</result>
        <result name="error" type="redirect">list.action</result>
</action>


When the addMember.action is called, it will add a member to DB. It will
return actionMessage on success and actionError on failure. The page will be
redirected back to list.action where the action message/error will be shown.

On success, the page will be redirected succesfully, with the method
"initDisplay" called.
However, on failure, the page will also be redirected. However, the method
initDisplay is never called.

Anyone know why is it so and if I have anything set wrongly?

Thanks in advance.

-- 
View this message in context: http://www.nabble.com/Action-method-is-not-called-when-the-page-is-redirected-with-actionError-tp15082435p15082435.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Action method is not called when the page is redirected with actionError

Posted by Al Sutton <al...@alsutton.com>.
Have a look at;

https://issues.apache.org/struts/browse/WW-1963


----- Original Message ----- 
From: "quinquin2209" <qu...@yahoo.com.hk>
To: <us...@struts.apache.org>
Sent: Friday, January 25, 2008 7:30 AM
Subject: Action method is not called when the page is redirected with 
actionError


>
> Hi All,
>
> I have the following 2 actions defined:
>
> <action name="list" class="mainAction" method="initDisplay">
>    <interceptor-ref name="store">
>       RETRIEVE
> </interceptor-ref>
> <interceptor-ref name="defaultStack" />
> <result name="input">/jsp/main.jsp</result>
> </action>
> <action name="addMember" class="mainAction" method="addMember">
>       <interceptor-ref name="store">
>       STORE
> </interceptor-ref>
>        <interceptor-ref name="defaultStack" />
>        <result name="success" type="redirect">list.action</result>
>        <result name="error" type="redirect">list.action</result>
> </action>
>
>
> When the addMember.action is called, it will add a member to DB. It will
> return actionMessage on success and actionError on failure. The page will 
> be
> redirected back to list.action where the action message/error will be 
> shown.
>
> On success, the page will be redirected succesfully, with the method
> "initDisplay" called.
> However, on failure, the page will also be redirected. However, the method
> initDisplay is never called.
>
> Anyone know why is it so and if I have anything set wrongly?
>
> Thanks in advance.
>
> -- 
> View this message in context: 
> http://www.nabble.com/Action-method-is-not-called-when-the-page-is-redirected-with-actionError-tp15082435p15082435.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org