title: Ajax json POST and Spring MVC Controller
body: <p>I have ajax json POST method like this </p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: "localhost:8080/webeditor/spring/json/", 
      data: JSON.stringify(contents),
      dataType: "json"
  });
  </code></pre>
  
  <p>Controller to handle post request</p>
  
  <pre><code>JSONPObject json;
  BindingResult result = new BeanPropertyBindingResult( json , "MyPresentation" );
  @RequestMapping(value="json/", method = RequestMethod.POST)
  public void savePresentationInJSON(Presentations presentation,BindingResult result) {
          //do some action
  
  }
  </code></pre>
  
  <p>but I getting this error </p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load localhost:8080/webeditor/spring/json/. Cross origin requests are only supported for HTTP.</p>
  </blockquote>
  
  <p>I'm not sure how to correct above error.</p>