广告合作
  • 今日头条

    今日头条

  • 百度一下

    百度一下,你就知道

  • 新浪网

    新浪网 - 提供新闻线索,重大新闻爆料

  • 搜狐

    搜狐

  • 豆瓣

    豆瓣

  • 百度贴吧

    百度贴吧——全球领先的中文社区

  • 首页 尚未审核订阅工具 订阅

    解决Spring的PageNotFound错误

    来源:网络收集  点击:  时间:2024-05-30
    【导读】:
    解决org.springframework.web.servlet.PageNotFound] - No mapping found for HTTP request with URI in DispatcherServlet with name SpringMVC错误工具/原料moreSpringmvcIntelliJ IDEAtomcat方法/步骤1/8分步阅读

    2016-06-05 23:43:03,329 WARN - No mapping found for HTTP request with URI in DispatcherServlet with name SpringMVC

    2/8

    经过研究和分析,解决办法如下:

    (1)查看项目的index页面是否能在浏览器正常打开

    3/8

    可以看到上面是可以打开的。

    查看配置org.springframework.web.servlet.DispatcherServlet前端控制器在web.xml文件中的servlet-name是什么。

    此处为SpringMVC

    4/8

    查看是否使用servlet-name-servlet.xml文件。此处没有使用

    即使用contextConfigLocation变量中的文件classpath:config/spring-context.xml来加载Spring应用上下文

    5/8

    其它会刚才打开首页的链接已经暗示,这个webapp的名字不是servletname

    因为打开的首页是这个webapp的index.jsp页面,不是tomcat默认的欢迎页

    6/8

    那就看看Controller中配置的内容吧

    可以看到class上配置的路径是@RequestMapping(value = /pubsub)

    @RequestMapping(value = /sub)public String Subscriber(Model model) {

    即url:http://localhost:8080/pubsub/pub可以打开/WEB-INF/jsp/subResult.jsp页面

    7/8

    have a try!

    与预期一致,页面可以正常打开,功能也正常

    8/8

    这个问题理顺后,看了看tomcat在deploy这个webapp里的日志,发现人家tomcat其实什么都给说了

    2016-06-05 23:42:22,923 INFO - JSR-250 javax.annotation.ManagedBean found and supported for component scanning

    2016-06-05 23:42:23,035 INFO - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1f55cb3: defining beans ; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@1353e78

    2016-06-05 23:42:23,157 INFO - Mapped URL path onto handler pubSubController

    2016-06-05 23:42:23,157 INFO - Mapped URL path onto handler pubSubController

    2016-06-05 23:42:23,157 INFO - Mapped URL path onto handler pubSubController

    2016-06-05 23:42:23,157 INFO - Mapped URL path onto handler pubSubController

    2016-06-05 23:42:23,157 INFO - Mapped URL path onto handler pubSubController

    2016-06-05 23:42:23,157 INFO - Mapped URL path onto handler pubSubController

    TOMCATPAGENOTFOUNDMVCSPRINGREDIS
    本文关键词:

    版权声明:

    1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。

    2、本站仅提供信息发布平台,不承担相关法律责任。

    3、若侵犯您的版权或隐私,请联系本站管理员删除。

    4、文章链接:http://www.1haoku.cn/art_862091.html

    相关资讯

    ©2019-2020 http://www.1haoku.cn/ 国ICP备20009186号05-07 16:15:38  耗时:0.026
    0.0265s