今天新建ssm项目时,由于新建的项目里面会自动生成一个index.jsp,然后启动tomcat时会自动访问index.jsp文件。当我把index.jsp文件删除,并在原位置添加一个index.html文件,并且在web.xml中配置:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
然后启动tomcat:
之后控制台报如下错
No mapping found for HTTP request with URI [/ssm_war_exploded/] in DispatcherServlet with name 'dispatcherServlet’
页面中提示如下:
经过百度,在springmvc.xml中加入:
mvc:default-servlet-handler/ 即可正常访问
特此记录一下
版权声明:本文为qq_39961766原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。