1. org.springframework.web.servlet.PageNotFound noHandlerFound
servlet配置如下:
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/spring/spring-servlet.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
解决方法:servlet-mapping里面的 /* 改为 / 即可。
2. 请求返回错误码:406 Not Acceptable
HTTP Status 406 -
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.
我设置的返回json格式,但是缺少支持包
见原文:http://jadethao.iteye.com/blog/1926525