Skip to content Skip to sidebar Skip to footer

Spring Mvc3 Rest Call Getting Http406 Using Angular

Here is my environment Spring 3.2.8.RELEASE included jackson-mapper-asl-1.7.9.jar, jackson-core-asl-1.7.9.jar Tomcat 6.x mvc:annotation-driven in Spring configuration XML file

Solution 1:

Try changing the mapping extension in the requestmapping of the method.

As of spring 3.2.x onwards the extension of the mapping has prevalence over the Accept and Content-Type headers at the time of resolving the expected content types. So, as you have defined the mapping as .htm, content negotiation resolver expects it to return html and nothing else. More info here

So use a non extension mapping or a generic one (I usually define my rest mappings with .service extension).

Be aware or reviewing the spring's dispatcher servlet mapping in web.xml o configuration class, as you might need to change or add additional mappings in order to make new mapping reach your controller.

Post a Comment for "Spring Mvc3 Rest Call Getting Http406 Using Angular"