title: Struts 2 get parameter in Action class
body: <p>I use Struts 2 and Ajax. I am not able to get parameter in Action class. I have a form like this: </p>
  
  <pre><code>&lt;s:form id="form" onSubmit="sendAjaxRequest();"&gt;
      &lt;s:textfield  name="libelle" label="Libelle" /&gt;
      &lt;s:textfield name="id" label="id" /&gt;
      &lt;s:submit value="Valider" /&gt;
      &lt;s:reset value="Effacer" /&gt;
  &lt;/s:form&gt;
  </code></pre>
  
  <p>When I examine the request which is sent in HTTP Reader :</p>
  
  <pre><code>Content-length contains libelle=Test&amp;id=13
  </code></pre>
  
  <p>My request is good ! </p>
  
  <p>In my action class :</p>
  
  <pre><code>public class MyAction extends ActionSupport {
      private String libelle;
      private Integer id;
  
      public String getLibelle() {
          return auteur;
      }
  
      public void setLibelle(String libelle) {
          this.libelle = libelle;
      }
  
      public String getId() {
          return id;
      }
  
      public void setId(Integer id) {
          this.id = id;
      }
      public String execute() {
          System.out.println("Libelle " + libelle);
          System.out.println("Libelle " + this.libelle);
      }
  }
  </code></pre>
  
  <p>In my Action libelle and this. libelle are null. I don't know if I am making mistakes. If someone could give me help. Thanks.</p>
  
  <p>I found my problem but not a solution. I inspect the html code generated and i see the following one : </p>
  
  <pre><code>&lt;form id="form" name="form" action="/path/MyOtherAction.action" method="post" onSubmit="sendAjaxRequest();"&gt;
    &lt;table class="wwFormTable"&gt;
        &lt;tr&gt;
            &lt;td class="tdLabel"&gt;&lt;label for="form_libelle" class="label"&gt;Libelle:&lt;/label&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="libelle" value="" id="form_libelle"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td class="tdLabel"&gt;&lt;label for="form_id" class="label"&gt;id:&lt;/label&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="ide" value="" id="form_id"/&gt;&lt;/td&gt;
        &lt;/tr&gt;
  ...
            &lt;td colspan="2"&gt;&lt;div align="right"&gt;&lt;input type="submit" id="form_0" value="Valider"/&gt;
  ..
            &lt;td colspan="2"&gt;&lt;div align="right"&gt;&lt;input type="reset" value="Effacer"/&gt;
  ..
    &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>So MyOtherAction is executed first before my sendAjaxRequest. How to remove action MyOtherAction in my form ?
  Thanks for reading.</p>