Struts 2
  1. Struts 2
  2. WW-4023

ParametersInterceptor produces a warning when parameter method:* is set

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.7, 2.3.8, 2.3.12
    • Fix Version/s: 2.3.16
    • Component/s: Core Interceptors
    • Labels:
      None

      Description

      The following example produces a form with the parameter names: number and method:add

      <s:form namespace="/example" action="example">
      <s:textfield name="number"/>
      <s:submit method="add" value="Add"></s:submit>
      </s:form>
      

      The ParametersInterceptor throws a warning when devMode is set:

      Parameter [method:add] didn't match acceptedPattern pattern!

      I think this warn message shouldn't be logged because it's a normal use case. The "method:" parameter should be included in the excludeParams configuration.

      This issue relates to WW-3973.

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          210d 11h 41m 1 Lukasz Lenart 21/Oct/13 10:50
          Resolved Resolved Closed Closed
          48d 6h 31m 1 Lukasz Lenart 08/Dec/13 17:21
          Lukasz Lenart made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Hudson added a comment -

          SUCCESS: Integrated in Struts2-JDK6 #815 (See https://builds.apache.org/job/Struts2-JDK6/815/)
          WW-4023 Adds action: and method: prefixes to excludeParams list and changes order to first check for excludeParams and then for acceptedParams in ParametersInterceptor (lukaszlenart: rev 1534089)

          • /struts/struts2/trunk/core/src/main/resources/struts-default.xml
          • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
          Show
          Hudson added a comment - SUCCESS: Integrated in Struts2-JDK6 #815 (See https://builds.apache.org/job/Struts2-JDK6/815/ ) WW-4023 Adds action: and method: prefixes to excludeParams list and changes order to first check for excludeParams and then for acceptedParams in ParametersInterceptor (lukaszlenart: rev 1534089) /struts/struts2/trunk/core/src/main/resources/struts-default.xml /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
          Lukasz Lenart made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Lukasz Lenart added a comment -

          Added action: and method: prefix to excludeParams list and changed order to first check for excluded params and then for accepted

          Show
          Lukasz Lenart added a comment - Added action: and method: prefix to excludeParams list and changed order to first check for excluded params and then for accepted
          Hide
          ASF subversion and git services added a comment -

          Commit 1534089 from Lukasz Lenart in branch 'struts2/trunk'
          [ https://svn.apache.org/r1534089 ]

          WW-4023 Adds action: and method: prefixes to excludeParams list and changes order to first check for excludeParams and then for acceptedParams in ParametersInterceptor

          Show
          ASF subversion and git services added a comment - Commit 1534089 from Lukasz Lenart in branch 'struts2/trunk' [ https://svn.apache.org/r1534089 ] WW-4023 Adds action: and method: prefixes to excludeParams list and changes order to first check for excludeParams and then for acceptedParams in ParametersInterceptor
          Hide
          Lukasz Lenart added a comment -

          Warn changed to:

          Parameter [method:login] is on the excludeParams list of patterns!
          

          I'm wondering if it's really an issue.

          Show
          Lukasz Lenart added a comment - Warn changed to: Parameter [method:login] is on the excludeParams list of patterns! I'm wondering if it's really an issue.
          Lukasz Lenart made changes -
          Assignee Lukasz Lenart [ lukaszlenart ]
          Hide
          Lukasz Lenart added a comment -

          Find a way - changed order of methods in isAcceptable to first check for excluded param names and then match against ACCEPTED_PARAM_NAMES

          Show
          Lukasz Lenart added a comment - Find a way - changed order of methods in isAcceptable to first check for excluded param names and then match against ACCEPTED_PARAM_NAMES
          Lukasz Lenart made changes -
          Comment [ Problem occurs only in devMode. The second is that ParametersInterceptor is in XWork core, but method:, action: and redirect: are defined in DefaultActionMapper in Struts2 core :\

          Adding them as a excludeParams will add cross dependency, I don't see a good solution now. ]
          Hide
          Lukasz Lenart added a comment - - edited

          The problem is that this is generated by isAcceptable method and default pattern defined in ACCEPTED_PARAM_NAMES - excluding method: and action: with excludeParams won't help.

          Show
          Lukasz Lenart added a comment - - edited The problem is that this is generated by isAcceptable method and default pattern defined in ACCEPTED_PARAM_NAMES - excluding method: and action: with excludeParams won't help.
          Lukasz Lenart made changes -
          Link This issue duplicates WW-4132 [ WW-4132 ]
          Lukasz Lenart made changes -
          Fix Version/s 2.3.16 [ 12324546 ]
          Fix Version/s 2.3.17 [ 12324780 ]
          Lukasz Lenart made changes -
          Fix Version/s 2.3.17 [ 12324780 ]
          Fix Version/s 2.3.16 [ 12324546 ]
          Lukasz Lenart made changes -
          Fix Version/s 2.3.16 [ 12324546 ]
          Fix Version/s 2.3.15 [ 12324267 ]
          Lukasz Lenart made changes -
          Priority Major [ 3 ] Minor [ 4 ]
          Lukasz Lenart made changes -
          Fix Version/s 2.3.15 [ 12324267 ]
          Fix Version/s 2.3.14 [ 12324256 ]
          Lukasz Lenart made changes -
          Field Original Value New Value
          Fix Version/s 2.3.14 [ 12324256 ]
          Jon Y. created issue -

            People

            • Assignee:
              Lukasz Lenart
              Reporter:
              Jon Y.
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development