Added annotations to the Controller class's methods: @ResponseBody
Page throws Error:
The resource identified by this request is a capable of generating responses with characteristics not acceptable accord ing to the request "accept" headers ()
The Web page can successfully dial in the method, but the returned JSON results are not received properly, and the page throws the above error.
Workaround:
In the Applicationcontext.xml header, add:
Xmlns:mvc= "Http://www.springframework.org/schema/mvc"
Add after Xsi:schemalocation:
Http://www.springframework.org/schema/mvc
Http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
Add MVC Annotations:<mvc:annotation-driven/>
Then, remove the following in the configuration file:
<bean class= "Org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
By the way,<mvc:annotation-driven/> 's meaning:
<mvc:annotation-driven/> will automatically register defaultannotationhandlermapping and annotationmethodhandleradapter two beans, is required by spring MVC to distribute the request to @controllers.
Call controller method in SPRINGMVC project to report 406 error