struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Pratt" <thechrispr...@gmail.com>
Subject Actionerrors & the Store Interceptor
Date Wed, 02 Apr 2008 18:29:17 GMT
We're having a problem configuring the system and, since this seems
like a common problem, we're hoping someone has found a solution.

We have a bunch of actions that can't be run twice, so we're using the
redirect-action result type to make sure a refresh doesn't
accidentally resubmit the request.  We also need to give the user a
pat on the back and let them know that things went well, so we're
setting an ActionMessage and using the store interceptor to pass the
message to the redirected page.  At this point everything's working
great.

The problem comes in when an error occurs.  At that point, we put
register an ActionError and forward the user back to the page they
were on to correct their error.  The page displays properly, including
the error message and everything looks fine, until...

The next time you hit a page using the store interceptor in RETRIEVE
mode, you get the ActionError display since the <s:actionerror> tag
doesn't seem to clear the messages once they are displayed.

Redirecting instead of forwarding back to the page wouldn't help since
the store interceptor is already in STORE mode, it seems like the
struts tags should remove the messages once displayed so that they
wouldn't be picked up by the interceptor.

Is there a way to handle this cleanly?  Thanks.
  (*Chris*)

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


Mime
View raw message