Chris,

I'm familiar with the code, but the main problem is that there is a "paper wall" between the StoreInterceptor and the jsp tags, so that one does not know or rely on how the other works.

As far as I'm aware this is only a philosophical decision, and there is no technical reason why the tags can't removed information stored in the StoreInterceptor, but I'm pretty sure it would need the nod of those on the dev list to get into the final build.

Al.
----- Original Message ----- From: "Chris Pratt" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Thursday, April 03, 2008 7:31 AM
Subject: Re: Actionerrors & the Store Interceptor


On Wed, Apr 2, 2008 at 11:17 PM, Al Sutton <[EMAIL PROTECTED]> wrote:
Chris,

 I've used the StoreInterceptor and my opinion is that it just isn't
flexible enough to use.

 To illustrate the point, consider try following;

 1) You have a View Action which displays all of the data of a specific
type, which uses the StoreInterceptor in retrieve in order to show
confirmation messages from an Update action.

 2) You have an Edit Action which sends the user to edit.jsp via the
dispatcher result type. edit.jsp has a menu taking the user to other places
in the app.

 3) You have an Update Action which is called by submitting a form on
edit.jsp, this can return the user to edit.jsp using the dispatcher if there is a problem with the form data, or it can take the user to the View Action
via a redirect if everything is OK. The Update Action uses the
StoreInterceptor in STORE mode in order to send a confirmation back to the
View Action.

 Now, if the user gets to the edit stage submits the form, but has made a
mistake which sends them back to edit.jsp, clicks on the menu to go to
another action they end up seeing the error message twice, once when the get
redirected back to edit.jsp from the UpdateAction, and a second time when
they click on any of the links from the menu on edit.jsp.

 If you want to track the resolution of this, you may want to look at the
JIRA issue I raised about 10 months ago...
https://issues.apache.org/struts/browse/WW-1963


Yup, that pretty much describes exactly what we're seeing.  I think
the simplest fix would be to add a parameter to the <s:actionerror>,
<s:actionmessage> and <s:fielderror> tags, something like
remove="true", that when the message has been displayed, it removes it
from the list.  That way, if the result ends up forwarding rather than
redirecting, and the messages get shown and removed, there will be
nothing for the store interceptor to store and the messages will be
displayed only once.

It should be a fairly simple fix and be completely backward compatible
with anyone showing the messages multiple times on purpose.

Unfortunately I haven't been able to find a good work-around to this
and I really don't have the time in my project to not only learn the
code well enough to make this change, but then learn maven and enough
of the build procedures to integrate it into my project.  I would love
to hear from ANYONE who has figured a way out of this spiral.  Thanks.
 (*Chris*)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to