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

Modify Action.getErrors to save the new ActionMessages

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 1.2.4
    • None
    • Extras
    • None
    • Operating System: All
      Platform: All
    • 31729

    Description

      org.apache.struts.action.Action contains

      protected ActionMessages getErrors(HttpServletRequest request) {
      ActionMessages errors =
      (ActionMessages) request.getAttribute(Globals.ERROR_KEY);
      if (errors == null)

      { errors = new ActionMessages(); }

      return errors;
      }

      It may be considered more robust if the new messages object was always placed
      in the request attribute thusly:

      protected ActionMessages getErrors(HttpServletRequest request) {
      ActionMessages errors =
      (ActionMessages) request.getAttribute(Globals.ERROR_KEY);
      if (errors == null)

      { errors = new ActionMessages(); request.setAttribute(Globals.ERROR_KEY, errors); }

      return errors;
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            richard.beton@roke.co.uk richard.beton
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: