Struts 1
  1. Struts 1
  2. STR-2463

addMessages/getMessages for session scope

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.4
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All

      Description

      Currently saveMessages supports both request and session scope, but
      addMessages and getMessages methods are only available for request scope.
      It would be really helpful if the API supported both request and session for
      all message related methods.

        Issue Links

          Activity

          Gavin made changes -
          Link This issue is depended upon by STR-3006 [ STR-3006 ]
          Gavin made changes -
          Link This issue blocks STR-3006 [ STR-3006 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12559355 ] jira [ 12587802 ]
          Mark Thomas made changes -
          Workflow jira [ 12549262 ] Default workflow, editable Closed status [ 12559355 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12545960 ] jira [ 12549262 ]
          Mark Thomas made changes -
          Workflow jira [ 12490697 ] Default workflow, editable Closed status [ 12545960 ]
          Jeff Turner made changes -
          Project Import Mon Feb 01 01:03:21 UTC 2010 [ 1264986201992 ]
          pbenedict made changes -
          Assignee Struts Developers [ dev@struts.apache.org ]
          pbenedict made changes -
          Link This issue blocks STR-3006 [ STR-3006 ]
          Don Brown made changes -
          Field Original Value New Value
          issue.field.bugzillaimportkey 34857 27754
          Hide
          Rodrigo S de Castro added a comment -

          Actually, I had a scenario where the messages where saved in one action in the
          session scope, since I wanted to redirect to another action. At this action, I
          get all the messages back and added a couple of information messages to the
          user. When I used the getMessages() I noticed it just checked for the messages
          object in the request scope, while I think the correct behaviour would be to
          check in both scopes.

          AppFuse implements a BaseAction with getMessages() and getErrors() that do check
          in both scopes, and I had to implement these methods in a BaseAction of mine to
          work properly. Otherwise I would have to save the messages in the request scope
          and stop redirecting, what I wouldn't like to do.

          What do you think?

          Show
          Rodrigo S de Castro added a comment - Actually, I had a scenario where the messages where saved in one action in the session scope, since I wanted to redirect to another action. At this action, I get all the messages back and added a couple of information messages to the user. When I used the getMessages() I noticed it just checked for the messages object in the request scope, while I think the correct behaviour would be to check in both scopes. AppFuse implements a BaseAction with getMessages() and getErrors() that do check in both scopes, and I had to implement these methods in a BaseAction of mine to work properly. Otherwise I would have to save the messages in the request scope and stop redirecting, what I wouldn't like to do. What do you think?
          Hide
          Niall Pemberton added a comment -

          The way Struts works in "normal" operation is to deal with errors or messages
          stored in request scope - hence the provision of convenience methods that
          facilitate that process. The reason save methods were added for session scope
          was specifically for the situation where someone wants to re-direct and not
          lose the errors or messages.

          IMO the methods provided are adequate for these requirements and the additional
          convenience methods you're requesting just adds clutter making it more
          confusing for people to understand which they should use.

          I think we should close this as "WONTFIX", but I'll leave it open in case
          anyone else disagrees or you want to make the case for why they should be
          included.

          Show
          Niall Pemberton added a comment - The way Struts works in "normal" operation is to deal with errors or messages stored in request scope - hence the provision of convenience methods that facilitate that process. The reason save methods were added for session scope was specifically for the situation where someone wants to re-direct and not lose the errors or messages. IMO the methods provided are adequate for these requirements and the additional convenience methods you're requesting just adds clutter making it more confusing for people to understand which they should use. I think we should close this as "WONTFIX", but I'll leave it open in case anyone else disagrees or you want to make the case for why they should be included.
          rey abe created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              rey abe
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development