title: ajax send data to controller
body: <p>I'm was wondering what is the difference between these two syntaxes: </p>
  
  <pre><code>  var value = $("#myForm").serialize();
    $.ajax({
      type: "post",
      url: "testMethod",
      data: value
  });
  </code></pre>
  
  <p>and </p>
  
  <pre><code>  var value = $("#myForm").serialize();
    $.ajax({
      type: "post",
      url: "testMethod",
      data: "valueName=" + value
  });
  </code></pre>
  
  <p>I thought they are the same but when I use the first one, in my spring controller this attribute have fully populated properties. When I use the second approach, all the properties of the attribute are null ??</p>
  
  <p>Someone have explanation for this?</p>
  
  <p>This is my <strong>JSP</strong>: </p>
  
  <pre><code>&lt;form:form id="myForm" action="*" modelAttribute="filters" &gt;
  
      &lt;form:input ...  path="age" /&gt;  
      &lt;form:input ...  path="gender" /&gt;   
      &lt;form:input ...  path="location" /&gt; 
  
  &lt;/form:form&gt;
  </code></pre>
  
  <p>This is JS</p>
  
  <pre><code>$('#ok_provinces_btn_id').click(function(){
  var second = $('#secondAttr').val();
  
  var f = $("#myForm").serialize();
  
  $.ajax({
      type: "post",
      url: "testMethod",
      data: ?????
  });
  </code></pre>
  
  <p>});</p>
  
  <p>This is my <strong>Controller</strong></p>
  
  <pre><code>    @RequestMapping(value="testMethod", method=RequestMethod.POST)
  public void testMethod(
          @ModelAttribute("filters") FiltersWrapper filters,
                      @RquestParam String second
          ){
  
               //Here the **second** param is OK 
      filters.getAge(); //NULL
  }
  </code></pre>