title: How to exclude the submit action from a list of parameters in Struts 2?
body: <p>I'm trying to exclude a submit action from a parameter list.</p>
  <p><strong>The following is the action class:</strong></p>
  <pre class="lang-java prettyprint-override"><code>@Namespace(&quot;/admin_side&quot;)
  @ResultPath(&quot;/WEB-INF/content&quot;)
  @InterceptorRefs({
      @InterceptorRef(value=&quot;validation&quot;, params={&quot;excludeMethods&quot;, &quot;test&quot;}),
      @InterceptorRef(value=&quot;params&quot;, params={&quot;excludeParams&quot;, &quot;action:postAction&quot;})})
  public final class TestAction extends ActionSupport implements Serializable, ValidationAware
  {
      private static final long serialVersionUID = 1L;
      private static final String SUCCESS = &quot;success&quot;;
  
      private String name;
  
      @Action(value = &quot;test&quot;, results = {
      @Result(name=&quot;success&quot;, location=&quot;Test.jsp&quot;),
      @Result(name = &quot;input&quot;, location = &quot;Test.jsp&quot;)})
      public String test() throws Exception
      {
          System.out.println(&quot;name = &quot;+name);
          return SUCCESS;
      }
  
      @Action(value = &quot;postAction&quot;, results = {
      @Result(name=&quot;success&quot;, location=&quot;Test.jsp&quot;),
      @Result(name = &quot;input&quot;, location = &quot;Test.jsp&quot;)})
      public String postAction()
      {
          System.out.println(&quot;Post invoked&quot;);
          System.out.println(&quot;name = &quot;+name);
          return SUCCESS;
      }
  
      @RequiredStringValidator(type= ValidatorType.FIELD, message = &quot;The name is required.&quot;)
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      @Override
      public void validate()
      {
          if(!hasErrors()&amp;&amp;name.length()&lt;2)
          {
              addFieldError(&quot;name&quot;, &quot;The name must compose of 2 letters.&quot;);
          }
      }
  }
  </code></pre>
  <p><strong>The <code>Test.jsp</code> page:</strong></p>
  <pre class="lang-jsp prettyprint-override"><code>&lt;s:form namespace=&quot;/admin_side&quot; action=&quot;test&quot; validate=&quot;true&quot;&gt;
      &lt;s:textfield id=&quot;name&quot; name=&quot;name&quot; label=&quot;Name&quot;/&gt;
      &lt;s:submit id=&quot;btnSubmit&quot; name=&quot;btnSubmit&quot; value=&quot;Submit&quot; action=&quot;postAction&quot;/&gt;
  &lt;/s:form&gt;
  </code></pre>
  <p>The generated HTML code for <code>&lt;s:submit&gt;</code> would be like as follows.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;input type=&quot;submit&quot; id=&quot;btnSubmit&quot; name=&quot;action:postAction&quot; value=&quot;Submit&quot;/&gt;
  </code></pre>
  <hr />
  <p>The <code>@InterceptorRef</code> above the class:</p>
  <pre><code>@InterceptorRef(value=&quot;params&quot;, params={&quot;excludeParams&quot;, &quot;action:postAction&quot;})
  </code></pre>
  <p>doesn't seem to work. The method <code>postAction()</code> is never invoked causing the following warning to be issued.</p>
  <blockquote>
  <p>Dec 24, 2013 10:49:16 PM
  com.opensymphony.xwork2.interceptor.ParametersInterceptor warn
  WARNING: Parameter [action:postAction] is on the excludeParams list of
  patterns!</p>
  </blockquote>
  <hr />
  <p>In the <code>struts.properties</code> file, I have the following properties until now.</p>
  <pre><code>struts.enable.DynamicMethodInvocation=false
  struts.devMode=false
  struts.ui.theme=simple
  
  struts.convention.package.locators=actions
  struts.convention.action.suffix=Controller
  struts.convention.action.mapAllMatches=true
  
  struts.convention.result.path=/WEB-INF/content //No need. It is the default.
  struts.mapper.action.prefix.enabled=true
  </code></pre>
  <p>I'm using Struts 2.3.16.</p>
  <hr />
  <p>Why doesn't it exclude the submit button's parameter? How to invoke the <code>postAction()</code> method, when <code>&lt;s:submit&gt;</code> is clicked?</p>