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]