Errors are stored in a request scope attribute and after a redirect they're
lost because a new request is launched by the client browser. You must
explicitly (by code) store them in a session attribute to get them in the
second request.
^^
On Dec 9, 2007 3:18 PM, Edgaras <[EMAIL PROTECTED]> wrote:
> Hallo,
>
> i want to redirect my errors "together" with page redirect...: if user is
> logged he should see message "person created" on StartPage.jsp and if
> not on Login.jsp. It works if I do directly forward, but if i redirect
> Login.jsp to StartPage.jsp error massege is gone. Could you help me
> :)
>
> Thanks
>
> Edgaras
>
> struts-config.xml:
>
>
>
> <global-forwards>
>
>
>
> <forward
>
> name="Start"
>
> path="/pages/StartPage.jsp" />
>
>
>
> </global-forwards>
>
>
>
> <action
>
> path="/CreatePerson"
>
> type="actions.CreatePerson"
>
> name="PersonForm"
>
> input="/pages/JoinUs.jsp"
>
> scope="request"
>
> validate="false">
>
>
>
> <forward
>
> name="success_create"
>
> path="/pages/Login.jsp" />
>
> Login.jsp:
> ....
> <logic:present name="user" scope="session">
> <logic:redirect forward="Start" />
> </logic:present>
> <font color="red"><html:errors/></font>
> ....
>
> CreatePerson.do:
> ...
> ActionMessages errors = new ActionMessages();
> errors.add"personcrated", new ActionMessage("message.person.created"));
> saveErrors(request, errors);
> return (mapping.findForward("success_create"));
> .....
>
>
>
>
>
>
>
>
>
>
> __________________________________________________________
> Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com
>
--
"Sit tibi terra levis"
http://yayocaturas.blogspot.com/