title: Controller does not accept data POST 404
body: <p>Help me please, I'm writing a site on java ee with spring mvc, I need to send the request to the servlet, but I get error 404.</p>
  
  <p><strong>my html:</strong></p>
  
  <pre><code>&lt;input type="button" value="add" onclick="sendRequest()"&gt;
  </code></pre>
  
  <p><strong>my js:</strong></p>
  
  <pre><code>function sendRequest(){
  var str = "this is string";
      $.ajax({
              url:"ajaxtest",
              type:"POST",
              //data:JSON.stringify(myJson).toString(),
              data:str,
              success: alert("good")
          });}
  </code></pre>
  
  <p><strong>my controller:</strong></p>
  
  <pre><code>@RequestMapping(value="ajaxtest", method=RequestMethod.POST)
      public void getAjax(String myStr){
          System.out.print("result : "+myStr);
      }
  </code></pre>
  
  <p><strong>result console browser:</strong></p>
  
  <pre><code>POST http://localhost/MyProject/ajaxtest 404 (Not Found)
  m.ajaxTransport.send - jquery-1.11.2.min.js:4 
  m.extend.ajax - jquery-1.11.2.min.js:4
  sendRequest - add.jsp:139
  onclick - add.jsp:213
  </code></pre>
  
  <p><strong>result console ide:</strong></p>
  
  <pre><code>INFO: Server startup in 2991 ms
  result : null
  </code></pre>
  
  <p>Please help me!</p>