title: Spring MVC and Ajax Operation using JQuery
body: <p>I have a JSP page called CreateProcessGroup.jsp and I use an annotation controller to map requests to CreateProcessGroup.htm to that page. But I'm having an interesting issue when I request the page from browser it works, when send a request using jQuery $.get method I get 404 (CreateProcessGroup.htm not found) is there a difference between two requests? </p>
  
  <p>My JSP page just under WebContent dir and JS file under WEBContent/Jquery my function sending the request like below:</p>
  
  <pre><code>function SendCreateProcessGroupRequest()
  {
  var pid = $('#pid').val();
  var description = $('#processGroupDescription').val();
  
  var x = "/CreateProcessGroup.htm";
  alert(x);
  
  $.get(x, { pid: 62, description: description },
             function(data){
               alert("Data Loaded: " + data);
             });
  }
  </code></pre>
  
  <p>Do I need to give the URL as <code>../CreateProcessGroup.htm</code>? Indeed I tried: </p>
  
  <ul>
  <li>/CreateProcessGroup.htm</li>
  <li>../CreateProcessGroup.htm</li>
  <li>/../CreateProcessGroup.htm</li>
  <li>../../CreateProcessGroup.htm</li>
  <li>/../../CreateProcessGroup.htm</li>
  </ul>
  
  <p>My guess is DispatcherServlet can not map Ajax requests to Controllers but this is stupid isn't it?</p>
  
  <p>How can i get rid of the situation?</p>
  
  <p>Thanks all.</p>