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

ParametersInterceptor excludeParams only applies to first instance of params interceptor in paramsPrepareParamsStack

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.1
    • Fix Version/s: 2.3.31, 2.5.5
    • Component/s: Core Interceptors
    • Labels:
      None

      Description

      I typically extend the existing stacks with my own interceptor references on an as needed basis, as shown below.

      The problem I face is that when I use the paramsPrepareParamsStack, I am noticing that the ParametersInterceptor excludes the custom defined entries on the first instance of the named params interceptor; however the second instance in the stack ignores these settings.

      <interceptor-stack name="customStack">
        <interceptor-ref name="myCustomInterceptor" />
        <interceptor-ref name="paramsPrepareParamsStack">
          <param name="fileUpload.maximumSize">20480000</param>
          <param name="params.excludeParams">
            dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,parameters\...*,submit,myObject\..*
          </param>
        </interceptor-ref>
      </interceptor-stack>
      

      I suspect the code is likely just applying the parameters to the first named instance and breaking the loop rather than making sure all instances of the named interceptor have the parameters applied correctly during Struts2 bootstrapping.

      The only workaround I've found is to avoid using the provided interceptor stack directly and copy it into my custom stack and explicitly set the excludeParams explicitly on both params interceptor instances.

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Struts-JDK7-master #517 (See https://builds.apache.org/job/Struts-JDK7-master/517/)
        WW-4667 Applies params to all instances of interceptor defined in stack (lukaszlenart: rev ab0cb82d31cbad47664dee423ddbf0894b004d27)

        • (edit) core/src/test/java/com/opensymphony/xwork2/config/providers/InterceptorBuilderTest.java
          WW-4667 Applies params to all instances of interceptor defined in stack (lukaszlenart: rev f6876ce6ce38f037a7480c6ae9bc26991feeaefe)
        • (edit) core/src/main/java/com/opensymphony/xwork2/config/providers/InterceptorBuilder.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Struts-JDK7-master #517 (See https://builds.apache.org/job/Struts-JDK7-master/517/ ) WW-4667 Applies params to all instances of interceptor defined in stack (lukaszlenart: rev ab0cb82d31cbad47664dee423ddbf0894b004d27) (edit) core/src/test/java/com/opensymphony/xwork2/config/providers/InterceptorBuilderTest.java WW-4667 Applies params to all instances of interceptor defined in stack (lukaszlenart: rev f6876ce6ce38f037a7480c6ae9bc26991feeaefe) (edit) core/src/main/java/com/opensymphony/xwork2/config/providers/InterceptorBuilder.java
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Done

        Show
        lukaszlenart Lukasz Lenart added a comment - Done
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit f6876ce6ce38f037a7480c6ae9bc26991feeaefe in struts's branch refs/heads/master from Lukasz Lenart
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=f6876ce ]

        WW-4667 Applies params to all instances of interceptor defined in stack

        Show
        jira-bot ASF subversion and git services added a comment - Commit f6876ce6ce38f037a7480c6ae9bc26991feeaefe in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=f6876ce ] WW-4667 Applies params to all instances of interceptor defined in stack
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit ab0cb82d31cbad47664dee423ddbf0894b004d27 in struts's branch refs/heads/master from Lukasz Lenart
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=ab0cb82 ]

        WW-4667 Applies params to all instances of interceptor defined in stack

        1. Conflicts:
        2. xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/InterceptorBuilder.java
        Show
        jira-bot ASF subversion and git services added a comment - Commit ab0cb82d31cbad47664dee423ddbf0894b004d27 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=ab0cb82 ] WW-4667 Applies params to all instances of interceptor defined in stack Conflicts: xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/InterceptorBuilder.java
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 6f5ddca47153886611c7fbeac1bf60fb35f0b8ba in struts's branch refs/heads/support-2-3 from Lukasz Lenart
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=6f5ddca ]

        WW-4667 Applies params to all instances of interceptor defined in stack

        Show
        jira-bot ASF subversion and git services added a comment - Commit 6f5ddca47153886611c7fbeac1bf60fb35f0b8ba in struts's branch refs/heads/support-2-3 from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=6f5ddca ] WW-4667 Applies params to all instances of interceptor defined in stack

          People

          • Assignee:
            Unassigned
            Reporter:
            crancran Chris Cranford
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development