一个SSM项目练习,遇到No mapping found for HTTP request with URI 问题无法解决,求大神指点

qq_35637712 2017-01-04 10:38:21












以上是我的工程结构目录和配置文件,没有其他报错,访问localhost:8080/item/XXXXX, 就No mapping found for HTTP request with URI ,百度了一晚上无法解决,求大神帮助
...全文
5954 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhuhao183 2019-09-07
  • 打赏
  • 举报
回复
context:component-scan base-package 的扫描路径没有包含controller
_王同学 2019-06-21
  • 打赏
  • 举报
回复
楼主,问题解决了么?
我这里也遇到了这个问题:
No mapping found for HTTP request with URI [/cloud_note/user/login.do] in DispatcherServlet with name 'mvc'
秦萧冷 2019-06-09
  • 打赏
  • 举报
回复
黑马的练手项目
妈呀! 2019-03-10
  • 打赏
  • 举报
回复
加上放行试试
<mvc:default-servlet-handler></mvc:default-servlet-handler>

  • 打赏
  • 举报
回复
黑马淘淘商城?
KyrieCao 2018-10-19
  • 打赏
  • 举报
回复
找到编译后的文件看一下是否存在,如果是新增的控制器有可能是没有编译导致的
YANG_93 2017-10-09
  • 打赏
  • 举报
回复
楼主 有没有解决 一样的问题
  • 打赏
  • 举报
回复
楼主有没有解决问题。。 我也遇到和你一样的问题了 no mapping
浮云若水 2017-01-06
  • 打赏
  • 举报
回复
首先你得保证你的tomcat中项目启动成功 ,如果tomcat项目都没启动成功,在怎么找问题也是无用功 吧tomcat日志打开看一下 是不是项目启动就报错了 不然没法定位问题点
zhouixi 2017-01-06
  • 打赏
  • 举报
回复
引用 3 楼 qq_34607261 的回复:
楼主这是mapper没有映射到数据库?我也在写这个项目,楼主加我啊,一起写
你下的源码里面有服务器的搭建过程吗。
cgs1999 2017-01-06
  • 打赏
  • 举报
回复
web.xml中SpringMVC的contextConfigLocation调整为 classpath: /Spring/springmvc.xml试试
什么都不能 2017-01-06
  • 打赏
  • 举报
回复
引用 10 楼 qnmdcsdn 的回复:
[quote=引用 8 楼 qq_35637712 的回复:] [quote=引用 1 楼 qnmdcsdn 的回复:] 访问地址中,不应该加上项目名的吗
而且我访问http://localhost:8080/ 也是404
引用 7 楼 hanpoyangtitan 的回复:
首先要学会看日志,启动日志包括容器的日志。spring的初始化日志里有The components scanned.

2017-01-05 22:09:40,709 INFO  handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler 'org.springframework.
web.servlet.resource.DefaultServletHttpRequestHandler#0'
2017-01-05 22:09:40,787 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/signon],methods=[GET]}" onto public j
ava.lang.String org.tom.pfms.web.controller.acl.login.LoginController.showSignOnForm(javax.servlet.http.HttpServletReque
st)
2017-01-05 22:09:40,803 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/signon],methods=[POST]}" onto public
java.lang.String org.tom.pfms.web.controller.acl.login.LoginController.doSignOnForm(javax.servlet.http.HttpServletReques
t)
2017-01-05 22:09:40,803 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/otheraccounts/delete]}" onto public j
ava.lang.String org.tom.pfms.web.controller.otheraccounts.OtherAccountsController.delete(javax.servlet.http.HttpServletR
equest) throws java.lang.Exception
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/otheraccounts/accounts]}" onto public
 java.lang.String org.tom.pfms.web.controller.otheraccounts.OtherAccountsController.showList(javax.servlet.http.HttpServ
letRequest) throws java.lang.Exception
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/portal]}" onto public java.lang.Strin
g org.tom.pfms.web.controller.root.RootAccessController.showPortal(javax.servlet.http.HttpServletRequest)
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/]}" onto public java.lang.String org.
tom.pfms.web.controller.root.RootAccessController.defaultAccess(javax.servlet.http.HttpServletRequest)
2017-01-05 22:09:40,834 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/token]}" onto public java.lang.String
 org.tom.pfms.web.controller.TokenController.getToken(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServl
etResponse)
没有明白,大神能直接粗浅点吗[/quote] tomcat首页都打不开?先把项目都移出去,保证能打开tomcat首页再说[/quote] 那你有ROOT项目吗?
  • 打赏
  • 举报
回复
引用 8 楼 qq_35637712 的回复:
[quote=引用 1 楼 qnmdcsdn 的回复:] 访问地址中,不应该加上项目名的吗
而且我访问http://localhost:8080/ 也是404
引用 7 楼 hanpoyangtitan 的回复:
首先要学会看日志,启动日志包括容器的日志。spring的初始化日志里有The components scanned.

2017-01-05 22:09:40,709 INFO  handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler 'org.springframework.
web.servlet.resource.DefaultServletHttpRequestHandler#0'
2017-01-05 22:09:40,787 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/signon],methods=[GET]}" onto public j
ava.lang.String org.tom.pfms.web.controller.acl.login.LoginController.showSignOnForm(javax.servlet.http.HttpServletReque
st)
2017-01-05 22:09:40,803 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/signon],methods=[POST]}" onto public
java.lang.String org.tom.pfms.web.controller.acl.login.LoginController.doSignOnForm(javax.servlet.http.HttpServletReques
t)
2017-01-05 22:09:40,803 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/otheraccounts/delete]}" onto public j
ava.lang.String org.tom.pfms.web.controller.otheraccounts.OtherAccountsController.delete(javax.servlet.http.HttpServletR
equest) throws java.lang.Exception
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/otheraccounts/accounts]}" onto public
 java.lang.String org.tom.pfms.web.controller.otheraccounts.OtherAccountsController.showList(javax.servlet.http.HttpServ
letRequest) throws java.lang.Exception
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/portal]}" onto public java.lang.Strin
g org.tom.pfms.web.controller.root.RootAccessController.showPortal(javax.servlet.http.HttpServletRequest)
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/]}" onto public java.lang.String org.
tom.pfms.web.controller.root.RootAccessController.defaultAccess(javax.servlet.http.HttpServletRequest)
2017-01-05 22:09:40,834 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/token]}" onto public java.lang.String
 org.tom.pfms.web.controller.TokenController.getToken(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServl
etResponse)
没有明白,大神能直接粗浅点吗[/quote] tomcat首页都打不开?先把项目都移出去,保证能打开tomcat首页再说
qq_35637712 2017-01-06
  • 打赏
  • 举报
回复
引用 11 楼 cgs1999 的回复:
web.xml中SpringMVC的contextConfigLocation调整为 classpath: /Spring/springmvc.xml试试
我试过,如果改成这样的话,就为报错无法找到springmvc.xml文件,应该是我工程结构问题
qq_35637712 2017-01-05
  • 打赏
  • 举报
回复
引用 7 楼 hanpoyangtitan 的回复:
首先要学会看日志,启动日志包括容器的日志。spring的初始化日志里有The components scanned.

2017-01-05 22:09:40,709 INFO  handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler 'org.springframework.
web.servlet.resource.DefaultServletHttpRequestHandler#0'
2017-01-05 22:09:40,787 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/signon],methods=[GET]}" onto public j
ava.lang.String org.tom.pfms.web.controller.acl.login.LoginController.showSignOnForm(javax.servlet.http.HttpServletReque
st)
2017-01-05 22:09:40,803 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/signon],methods=[POST]}" onto public
java.lang.String org.tom.pfms.web.controller.acl.login.LoginController.doSignOnForm(javax.servlet.http.HttpServletReques
t)
2017-01-05 22:09:40,803 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/otheraccounts/delete]}" onto public j
ava.lang.String org.tom.pfms.web.controller.otheraccounts.OtherAccountsController.delete(javax.servlet.http.HttpServletR
equest) throws java.lang.Exception
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/otheraccounts/accounts]}" onto public
 java.lang.String org.tom.pfms.web.controller.otheraccounts.OtherAccountsController.showList(javax.servlet.http.HttpServ
letRequest) throws java.lang.Exception
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/portal]}" onto public java.lang.Strin
g org.tom.pfms.web.controller.root.RootAccessController.showPortal(javax.servlet.http.HttpServletRequest)
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/]}" onto public java.lang.String org.
tom.pfms.web.controller.root.RootAccessController.defaultAccess(javax.servlet.http.HttpServletRequest)
2017-01-05 22:09:40,834 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/token]}" onto public java.lang.String
 org.tom.pfms.web.controller.TokenController.getToken(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServl
etResponse)
根据我推测是没有扫描到controller,但是根据我自己的配置,我搞不懂为什么会这样
qq_35637712 2017-01-05
  • 打赏
  • 举报
回复
引用 1 楼 qnmdcsdn 的回复:
访问地址中,不应该加上项目名的吗
而且我访问http://localhost:8080/ 也是404
引用 7 楼 hanpoyangtitan 的回复:
首先要学会看日志,启动日志包括容器的日志。spring的初始化日志里有The components scanned.

2017-01-05 22:09:40,709 INFO  handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler 'org.springframework.
web.servlet.resource.DefaultServletHttpRequestHandler#0'
2017-01-05 22:09:40,787 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/signon],methods=[GET]}" onto public j
ava.lang.String org.tom.pfms.web.controller.acl.login.LoginController.showSignOnForm(javax.servlet.http.HttpServletReque
st)
2017-01-05 22:09:40,803 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/signon],methods=[POST]}" onto public
java.lang.String org.tom.pfms.web.controller.acl.login.LoginController.doSignOnForm(javax.servlet.http.HttpServletReques
t)
2017-01-05 22:09:40,803 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/otheraccounts/delete]}" onto public j
ava.lang.String org.tom.pfms.web.controller.otheraccounts.OtherAccountsController.delete(javax.servlet.http.HttpServletR
equest) throws java.lang.Exception
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/otheraccounts/accounts]}" onto public
 java.lang.String org.tom.pfms.web.controller.otheraccounts.OtherAccountsController.showList(javax.servlet.http.HttpServ
letRequest) throws java.lang.Exception
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/portal]}" onto public java.lang.Strin
g org.tom.pfms.web.controller.root.RootAccessController.showPortal(javax.servlet.http.HttpServletRequest)
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/]}" onto public java.lang.String org.
tom.pfms.web.controller.root.RootAccessController.defaultAccess(javax.servlet.http.HttpServletRequest)
2017-01-05 22:09:40,834 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/token]}" onto public java.lang.String
 org.tom.pfms.web.controller.TokenController.getToken(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServl
etResponse)
没有明白,大神能直接粗浅点吗
qq_34607261 2017-01-05
  • 打赏
  • 举报
回复
楼主这是mapper没有映射到数据库?我也在写这个项目,楼主加我啊,一起写
什么都不能 2017-01-05
  • 打赏
  • 举报
回复
首先要学会看日志,启动日志包括容器的日志。spring的初始化日志里有The components scanned.

2017-01-05 22:09:40,709 INFO  handler.SimpleUrlHandlerMapping - Mapped URL path [/**] onto handler 'org.springframework.
web.servlet.resource.DefaultServletHttpRequestHandler#0'
2017-01-05 22:09:40,787 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/signon],methods=[GET]}" onto public j
ava.lang.String org.tom.pfms.web.controller.acl.login.LoginController.showSignOnForm(javax.servlet.http.HttpServletReque
st)
2017-01-05 22:09:40,803 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/signon],methods=[POST]}" onto public
java.lang.String org.tom.pfms.web.controller.acl.login.LoginController.doSignOnForm(javax.servlet.http.HttpServletReques
t)
2017-01-05 22:09:40,803 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/otheraccounts/delete]}" onto public j
ava.lang.String org.tom.pfms.web.controller.otheraccounts.OtherAccountsController.delete(javax.servlet.http.HttpServletR
equest) throws java.lang.Exception
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/otheraccounts/accounts]}" onto public
 java.lang.String org.tom.pfms.web.controller.otheraccounts.OtherAccountsController.showList(javax.servlet.http.HttpServ
letRequest) throws java.lang.Exception
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/portal]}" onto public java.lang.Strin
g org.tom.pfms.web.controller.root.RootAccessController.showPortal(javax.servlet.http.HttpServletRequest)
2017-01-05 22:09:40,819 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/]}" onto public java.lang.String org.
tom.pfms.web.controller.root.RootAccessController.defaultAccess(javax.servlet.http.HttpServletRequest)
2017-01-05 22:09:40,834 INFO  annotation.RequestMappingHandlerMapping - Mapped "{[/token]}" onto public java.lang.String
 org.tom.pfms.web.controller.TokenController.getToken(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServl
etResponse)
qq_35637712 2017-01-05
  • 打赏
  • 举报
回复
引用 3 楼 qq_34607261 的回复:
楼主这是mapper没有映射到数据库?我也在写这个项目,楼主加我啊,一起写
应该不是
qq_35637712 2017-01-05
  • 打赏
  • 举报
回复
引用 2 楼 bcsflilong 的回复:
看看是不是不输入的访问地址有问题
没有输错啊
加载更多回复(3)

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧