title: How to send json String from jsp page to Spring mvc controller
body: <p>I am trying to pass a simple json string to my controller,but it is not getting at there.I have a lot of other fields like inserting deleting etc inside my controller code,all of them will works perfectly,except this Json receiving.I tried a lot but not able to find out.I checked the path given and its correct.Is anything wrong with my controller code?Any help will be highly appreciable</p>
  
  <p>My jsp code</p>
  
  <pre><code>var obj=new Object();
      obj.sm=startMonth;
      obj.sd=startDay;
      obj.em=endMonth;
      obj.ed=endDay;
  
   var jsonDate= JSON.stringify(obj);
  
      $.ajax({
          type: 'POST',      
          dataType: 'json',
          url:"/proj/test/dateVerification",
          data:jsonDate,
  
          success: function(jsonDate) {//upto this line from my browser debugger it works
              if (response == jsonDate)
              {
              alert("success and json passed");
              } else {
              alert("not success"+response);
              }
          },
          error:function(xhr, errorType, exception) { 
  
              alert("inside error function 1(xhr)"+JSON.stringify(xhr));
              alert("inside error function 2(errorType)"+errorType);
              alert("inside error function 3(exception)"+exception);
          }
      });
  </code></pre>
  
  <p>This is my spring mvc controller code.</p>
  
  <pre><code>@RequestMapping(value = "dateVerification" , method = RequestMethod.POST)
      public @ResponseBody String dateVerification(@RequestParam(value="jsonDate",required=true) String jsonDate) {
  
          JOptionPane.showMessageDialog(null, jsonDate);
          System.out.println("JSON Success"+jsonDate);     
         return jsonDate;
      }
  </code></pre>
  
  <p>I am not able to print this Joption and sysout in my controller.Is there anything wrong with my controller code?</p>
  
  <p>Any help will be highly appreciable.</p>