Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2391

Allow saveErrors(session, messages) like saveMessages(session, messages)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.4
    • 1.2 Family
    • Core
    • 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>

      Attachments

        Activity

          People

            Unassigned Unassigned
            mraible@apache.org Matt Raible
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: