title: Getting 400 bad request error in Jquery Ajax POST in jsp file
body: <p>I am performing simple crud operation during this I am getting 400 bad request error on console 
  i.e. POST  <a href="http://localhost:8080/student/getDetails" rel="nofollow noreferrer">http://localhost:8080/student/getDetails</a>  400</p>
  
  <p>my code :</p>
  
  <pre><code>&lt;body&gt;
  
  &lt;form &gt; 
  
  Enter Student id:  &lt;input type="number" id="id" name="id"/&gt;&lt;br/&gt;
  &lt;button id="selectButton" onclick="getStudent()"&gt;Get Student&lt;/button&gt;
  
  &lt;/form&gt;
  
  &lt;script type="text/javascript"
      src="http://code.jquery.com/jquery-1.10.1.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      function getStudent() {
          $.ajax({
              type: "POST",
              url : "/student/getDetails",
              contentType: "application/json; charset=utf-8", 
              dataType: "json", 
              success : function(data) 
              {
                  alert(data);
              },
              error: function (data) {
                  alert(data);
          }
          });
      }
  &lt;/script&gt;
  
  
  &lt;/body&gt;
  </code></pre>