[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    Message Store Interceptor - can not display error message with
From:       doahh <gavin () prodia ! co ! uk>
Date:       2008-08-30 18:59:45
Message-ID: 19236073.post () talk ! nabble ! com
[Download RAW message or body]


I haven't used the 
http://struts.apache.org/2.0.11/docs/message-store-interceptor.html Message
Store Interceptor  so I maybe be using it wrongly or it could be by setup is
a little twisted.

I have a single error page for my web application. The error page will show
<s:actionerror /> if they are available and if not it will check the
querystring to see if there is a parameter denoting an error such as
accountActivated=false. If accountActivated=false then the error page will
display an error message. It is done this way because I am using both HDIV
and CAS which can't add actionError messages:

1) If a users account is not activated then they are redirected to the error
page with accountActivated=false as the query string;
2) The error page then shows a form that allows the user to enter their
email address and have their activation code resent out to them, in case
they have lost/deleted it;
3) If they enter an invalid email into the form then the Struts 2 validator
framework redirects the user to the error page but does it through an
action-redirect so that I can re-attach my accountActivated=false (which
struts re-writes to accountActivated=0).

However, doing this I loose my error messages so I am trying to use the
Message Store Interceptor but not being successful. My code is as follows:

<action name="resend-activation-code"
class="uk.co.prodia.prosoc.struts2.action.ActionResendActivationCode">
            <interceptor-ref name="defaultStack"/> 
            <interceptor-ref name="store">
                STORE
            </interceptor-ref>
            <result name="input" type="redirect-action">
               
resend-activation-code-validation-error?accountActivated=false
                /unsecured
            </result>
        </action>
        
        <action name="resend-activation-code-validation-error">
            <interceptor-ref name="defaultStack"/> 
            <interceptor-ref name="store">
                RETRIEVE
            </interceptor-ref>
            <result
name="success">/WEB-INF/page/user/unsecured/error.jsp</result>
        </action>

Can anyone see what I am doing wrong?
-- 
View this message in context: \
http://www.nabble.com/Message-Store-Interceptor---can-not-display-error-message-with-%3Cs%3Aactionerror--%3E-tp19236073p19236073.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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic