struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34857] - addMessages/getMessages for session scope
Date Wed, 06 Dec 2006 20:19:14 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34857>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34857





------- Additional Comments From apache@jtheory.com  2006-12-06 12:19 -------
I was also forced to add these into an Action subclass.  Messages are one of
those Struts features that is a frequent cause of "silent breakage" in my
projects, because it's rare that every developer on the team understands the
subtle repercussions of changing a forward to "redirect", or forwarding to
another action (which calls "saveMessages()" again and wipes out existing
messages, etc.).  And of course there's no error message when these things go
awry, to alert them to the malfunction or give them a headstart debugging, if
they even notice there's problem.

I googled up this bug because it seemed like a no-brainer to add these methods,
and I was trying to find which version of Struts added them.

My team is using the standard "POST-redirect-GET" model for actions that change
the database, as the cleanest solution to avoiding unintentional resubmits (but
still allowing *intentional* resubmits -- the token system fouls that up).

Messages are again difficult to manage correctly.  The newish saveMessages()
that takes the Session seemed like a great solution -- I don't want to load up
the session, but the "redirect" option on a forward is basically useless without
it.  But then we noticed that when the "change" action redirected to the "view"
action, messages disappeared.  A peek at the source of saveMessages() answered
the question, and addMessages() seemed like the solution -- but without the
session support, that's just as useless.

Personally, I don't understand why the *default* behavior of saveMessages() is
to discard all existing messages.  When would that be desirable?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message