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

          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.
          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
          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.
          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 -

          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
          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

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development