IDEA的Spring项目配置本地Tomcat来启动报错排解
错误提示:
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.
大概意思就是找不到路径。然后看控制台信息
org.springframework.web.servlet.DispatcherServlet.noHandlerFound No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'springmvc'
意思就是说找不到/和对应配置的进行对应起来。
找到问题了,那就开始排查吧。 先看web.xml的配置信息
<servlet-mapping><servlet-name>springmvc</servlet-name><url-pattern>/</url-pattern></servlet-mapping>
也就是说要请求 的方式才能进行访问我们的接口,
再看IDEA的
是一个/号,也就是两边配置的信息不一样导致的。修改为// 并发端口修改了80端口。
启动,访问即可。