title: Why Struts1 ajax ActionForm values all null
body: <p>In Struts1 project I'm trying to send ajax,
  <br>the chrome request payload is fine{"account":"abcd","pwd":"1234"}
  <br>but in debugMode the actionForm's values all null.</p>
  
  <p>the ajax area:</p>
  
  <pre><code>function loging() {
          alert(getFormData());
          $.ajax({
              url : '${pageContext.request.contextPath}/hello.do?method=jsonHi',
              type : 'POST',
              data : getFormData(),
              contentType : 'application/json',
              dataType : 'json',
              async:false,
              success : function(data) {
                  alert("success");
              },
              error : function() {
                  alert("error！");
              }
          });
      }
  function getFormData() {
          return JSON.stringify({
              'account' : $("#account").val(),
              'pwd' : $("#pwd").val()
          });
      };
  </code></pre>
  
  <p>the struts-config area:</p>
  
  <pre><code>&lt;struts-config&gt;
  &lt;form-beans&gt;
      &lt;form-bean name="formClass" type="com.pete.form.AccountForm" /&gt;
  &lt;/form-beans&gt;
  
  &lt;action-mappings&gt;
      &lt;action name="formClass" path="/hello" parameter="method" type="com.pete.action.HelloAction" scope="request" validate="false"&gt;
          &lt;forward name="helloUser" path="/WEB-INF/pages/hello.jsp" /&gt;
          &lt;forward name="jsonHi" path="/WEB-INF/pages/afterAjax.jsp"/&gt;
      &lt;/action&gt;
  &lt;/action-mappings&gt;
  </code></pre>
  
  <p></p>
  
  <p>the form area:</p>
  
  <pre><code>    public class AccountForm extends ActionForm{
  
      private static final long serialVersionUID = -7462505002509046403L;
      private String account = null;
      private String pwd= null;
      public String getAccount() {
          return account;
      }
      public void setAccount(String account) {
          this.account = account;
      }
      public String getPwd() {
          return pwd;
      }
      public void setPwd(String pwd) {
          this.pwd = pwd;
      }   
  }
  </code></pre>
  
  <p>teh Action area:</p>
  
  <pre><code>    public class HelloAction extends DispatchAction {
      public ActionForward jsonHi(ActionMapping mapping, ActionForm form, HttpServletRequest request,
              HttpServletResponse response) throws Exception {
          AccountForm reqForm = (AccountForm) form;
          System.out.println(reqForm.getAccount());//console is null
          System.out.println(reqForm.getPwd());// console is null
          return null;
      }
  
  }
  </code></pre>
  
  <p>I don't know what happen the form's values is null</p>