美文网首页
使用springmvc遇到的一些问题

使用springmvc遇到的一些问题

作者: 某某程序员_ | 来源:发表于2017-06-03 10:35 被阅读0次

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

相关文章

网友评论

      本文标题:使用springmvc遇到的一些问题

      本文链接:https://www.haomeiwen.com/subject/qxbpfxtx.html