Spring MVC Ajax error 406
<p>I am having trouble with simple ajax POST request. When I call doAjax on page load it returns me erorr 406 not acceptable. I have correct dependencies.</p>

<p>Simple model</p>

<pre><code>package proj1.models;

public class Popravilo{
    public String id = null;
    public String name = null;
}
</code></pre>

<p>Controller</p>

<pre><code>@RequestMapping(value = "car_list", method = RequestMethod.POST, produces = "application/json")
public @ResponseBody Popravilo showPopravila(){
        Popravilo p = new Popravilo();
        p.id="1";
        p.name ="p1";

        return p;
}
</code></pre>

<p>Ajax</p>

<pre><code> $(document).ready(function(){
        doAjaxPost();
    });
    function doAjaxPost() {
        $.ajax({
            type: "POST",
            url: "car_list.htm",
            success: function(response) {
               console.log(response);
            }
        });
    }
</code></pre>

<p>Dispatcher servlet</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="  http://www.springframework.org/schema/beans     
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc 
        http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context.xsd"&gt;


 &lt;mvc:resources mapping="WEB-INF/resources/*" location="resources/"     cache-period="31556926"/&gt;

    &lt;mvc:annotation-driven /&gt;

&lt;context:component-scan base-package="proj1.controllers"&gt;&lt;/context:component-scan&gt;

&lt;/beans&gt;
</code></pre>

<p>web.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"&gt;
  &lt;display-name&gt;proj1&lt;/display-name&gt;
  &lt;welcome-file-list&gt;
    &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
    &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
    &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
    &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
    &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;

  &lt;servlet&gt;
      &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; 
  &lt;/servlet&gt;

  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
    &lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
    &lt;url-pattern&gt;*.json&lt;/url-pattern&gt;
    &lt;url-pattern&gt;*.xml&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;

&lt;/web-app&gt;
</code></pre>

<p>Error info
<a href="https://i.stack.imgur.com/9k6u1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9k6u1.png" alt="Headers"></a></p>