Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4715

Scope interceptor always resets because of org.apache.struts2.dispatcher.HttpParameters

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.5
    • 2.5.8
    • Core Interceptors
    • None

    Description

      Line 302 of org.apache.struts2.interceptor.ScopeInterceptor performs a not-null check to see if a session reset parameter exists by calling com.opensymphony.xwork2.ActionContext.getParameters().get(...).

      The return type of getParameters() is org.apache.struts2.dispatcher.HttpParameters, and HttpParamters.get() never returns null on a missing parameter, causing the not-null check to always evaluate to true.

      This breaks the interceptor by short circuiting the scoped variable injection.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            xxbeanxx Greg Baker
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment