title: Required String parameter is not present error in Spring MVC
body: <p>I try to make an AJAX query to my controller in Spring MVC.</p>
  
  <p>My action code is:</p>
  
  <pre><code>@RequestMapping(value = "events/add", method = RequestMethod.POST)
  public void addEvent(@RequestParam(value = "start_date") String start_date, @RequestParam(value = "end_date") String end_date, @RequestParam(value = "text") String text, @RequestParam(value = "userId") String userId){
      //some code    
  }
  </code></pre>
  
  <p>My Ajax query is:</p>
  
  <pre><code>$.ajax({
          type: "POST",
          url:url,
          contentType: "application/json",
          data:     {
                  start_date:   scheduler.getEvent(id).start_date,
                  end_date:  scheduler.getEvent(id).end_date,
                  text: scheduler.getEvent(id).text,
                  userId: userId
          },
          success:function(result){
           //here some code
          }
      });
  </code></pre>
  
  <p>But I got an error: </p>
  
  <blockquote>
    <p>Required String parameter ''start_date is not present</p>
  </blockquote>
  
  <p>Why?
  As I know I presented it like <code>(@RequestParam(value = "start_date") String start_date</code></p>
  
  <p><strong>UDP</strong><br>
  Now I give 404
  My class to take data</p>
  
  <pre><code>public class EventData {
      public String end_date;
      public String start_date;
      public String text;
      public String userId;
      //Getters and setters
  }
  </code></pre>
  
  <p>My js AJAX call is:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url:url,
      contentType: "application/json",
      // data: eventData,
      processData: false,
      data:    JSON.stringify({
          "start_date":   scheduler.getEventStartDate(id),
          "end_date":  scheduler.getEventEndDate(id),
          "text": scheduler.getEventText(id),
          "userId": "1"
      }),
  </code></pre>
  
  <p>And controller action:</p>
  
  <pre><code>@RequestMapping(value = "events/add", method = RequestMethod.POST)
  public void addEvent(@RequestBody EventData eventData){    
  }
  </code></pre>
  
  <p>And JSON data is:</p>
  
  <pre><code>end_date: "2013-10-03T20:05:00.000Z"
  start_date: "2013-10-03T20:00:00.000Z"
  text: "gfsgsdgs"
  userId: "1"
  </code></pre>