错误提示:
HTTP Status 404 – 未找到
Type Status Report描述 The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
大概意思就是找不到路径。然后看console控制台信息
org.springframework.web.HandlerFound No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'springmvc'
意思就是说DispatcherServlet找不到/和对应配置的springmvc进行对应起来。
找到问题了,那就开始排查吧。 先看l的配置信息
<servlet-mapping><servlet-name>springmvc</servlet-name><url-pattern>/</url-pattern></servlet-mapping>
也就是说要请求 localhost/springmvc/的方式才能进行访问我们的接口,
再看IDEA的Configurations
是一个/号,也就是两边配置的信息不一样导致的。修改为/springmvc/ 并发端口修改了80端口。
启动,访问即可。
看了很多网上的解决方法发现都是有错了,还是自己看日志排查最靠谱。
本文发布于:2024-01-31 23:41:38,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170671570132243.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |