Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.2.4
-
None
-
Operating System: Mac OS X 10.0
Platform: Macintosh
-
33918
Description
I've found that saving errors in the session can be useful when I need to do a
redirect after catching the error. Since saveMessage() can save into the
session and auto-remove them, I'd think it'd be easy enough to do this with
saveErrors().
As a workaround, in my Action I'm using:
session.setAttribute(Globals.ERROR_KEY, messages);
And in my JSP:
<%-- Error Messages --%>
<logic:messagesPresent>
<div class="error">
<html:messages id="error">
<bean:write name="error" filter="false"/><br/>
</html:messages>
<!-- Error messages aren't automatically removed -->
<c:remove scope="session" var="org.apache.struts.action.ERROR"/>
</div>
</logic:messagesPresent>