title: Jquery ajax request with json data is not reaching spring mvc controller
body: <p>I need to send data to spring mvc controller from view using jquery. Spring mvc will insert/update these values in db. I am using below code</p>
  
  <p>JQuery:</p>
  
  <pre><code> var json = {"KPI" : visual, "partnerName": params['partnerName'],
   "partnerAddress" : params['partnerAddress'], "documentType" : params['documentType'], 
   "itemQualifier": getItemQualifier(),"itemIdentifiers" : params['itemIdentifiers'], 
   "currency" : getCurrency(), "sellSide": getSellSide()};
  
   $.ajax({                                                                   
          type: "POST",
          url: "/reports/savefilters",
          data: json,
          success: function(response){
                   alert('success: ' + response);
                  },
          error: function(e){ 
                   alert('Error: ' + e);
                  }
   });
  </code></pre>
  
  <p>Spring MVC controller Code:</p>
  
  <pre><code>@RequestMapping(value="/savefilters", method=RequestMethod.POST)
  public String saveFilters(@RequestBody AnalyticsFilters filters){
      System.out.println("savefilters method in controller");
      System.out.println("KPI:"+filters.getKPI());
      if(filters.getPartnerName() != null &amp;&amp; filters.getPartnerName().size()&gt;0 ) System.out.println("partnerName:"+filters.getPartnerName().get(0));
      if(filters.getPartnerAddress() != null &amp;&amp; filters.getPartnerAddress().size()&gt;0 ) System.out.println("partnerAddress:"+filters.getPartnerAddress().get(0));
      if(filters.getDocumentType() != null &amp;&amp; filters.getDocumentType().size()&gt;0 ) System.out.println("documentType:"+filters.getDocumentType().get(0));
      System.out.println("itemQualifier:"+filters.getItemQualifier());
      if(filters.getItemIdentifiers() != null &amp;&amp; filters.getItemIdentifiers().size()&gt;0 ) System.out.println("itemIdentifiers:"+filters.getItemIdentifiers().get(0));
      System.out.println("currency:"+filters.getCurrency());
      System.out.println("sellSide:"+filters.getSellSide());
      new DashboardDisplayService().saveFilters();
      return "successful";
  }
  </code></pre>
  
  <p>Post request is getting converted to Get method and not able to reach spring mvc controller. I tried with different ajax json options like datatype,contenttype etc. how to make sure POST request doesn't change to GET method???</p>