struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Yu <>
Subject Re: Redirect and ActionErrors don't play together--is there another way?
Date Thu, 29 Aug 2002 04:21:54 GMT
Hi Dennis,

saveErrors() stores the ActionErrors in the request. Since doing a 
'redirect' creates a new request, you will lose the errors.

What you can do is:

1. in, put the ActionErrors into the session and then redirect to
2. in, remove the ActionErrors from the session and use it to call 
3. forward to the jsp.

Besides, while the following post doesn't address directly your issue, it 
is relevant:

At 11:12 pm 28-08-2002, you wrote:
>Here's my situation: I have a screen that contains a table of objects
>(say the screen is displayed by ""). There is a link on the
>screen that causes a new object to be created by a Struts action (call
>it ""). The action forwards back to "". If the
>creation was successful, the table should now show the list of objects
>with the newly-created one added. If the creation failed, the table
>should display along with an error message.
>Here's my problem: when the "Create" link is clinked, the Action that
>does the work needs to do a redirect forward to "". Otherwise
>you end up with "" in the browser location bar, and if
>the user then does a refresh on the table screen, instead of refreshing
> the browser attempts to refresh, which is wrong. The
>redirect solves this problem, except for error cases. If creation fails,
>I want to display an error message on the table screen. But all
>ActionErrors associated with the request are lost when I redirect.
>Any workarounds?

John Yu                       Scioworks Technologies
e:         w: +(65) 873 5989
w:   m: +(65) 9782 9610

Scioworks Camino - "Don't develop Struts Apps without it!"

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message