title: Why does @ResponseBody on a void method with Spring MVC show no element found in the Firefox console?
body: <p>I have a Spring MVC controller that I am calling via JQuery.ajax.</p>
  
  <p>The mapping in the controller is:</p>
  
  <pre><code>@RequestMapping(value = "/remove", method = RequestMethod.POST)
  @ResponseBody
  public void remove(@RequestParam("value1") String value1,
                     @RequestParam("value2") String value2)
  {
    // do stuff
  }
  </code></pre>
  
  <p>The ajax call is:</p>
  
  <pre><code>$.ajax({
      url: '/appserver/model/remove',
      data: { value1: value1, value2: value2 },
      type: 'POST',
      traditional: true,
      success: function() {
        // do something on success
      },
      error: function(jqXHR, textStatus, errorThrown) {
        // do something on error
      }
    });
  </code></pre>
  
  <p>The POST call completes successfully with HTTP status 200. However, in the Firefox console the following is output:</p>
  
  <pre><code>no element found ... myscript.js:1
  </code></pre>
  
  <p>If I change my controller to return a boolean then this error disappears. However, according to <a href="https://stackoverflow.com/questions/12837907/what-to-return-if-spring-mvc-controller-method-doesnt-return-value">this question</a> having @ResponseBody on a method with void return type is valid.</p>
  
  <p>Is there anything I can change to remove this message?</p>