No mapping found for HTTP request with URI [***.html] in DispatcherServlet with name "***"
程序员文章站
2022-07-15 13:25:35
...
问题描述:
正在使用ssm框架搭建小demo。启动Tomcat服务器,jsp页面可以访问。但是html页面访问不了。嘿 我这暴脾气,为何前两天我写html页面都可以访问,今天写的却不行了。
问题原因:在web.xml文件中配置前端控制器的时候,url-pattern
配置的/。它会拦截除了jsp页面的所有URL。并交给前端控制器处理。所以导致不能访问.html文件。
解决办法:
在web.xml文件中添加如下配置:
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
推荐阅读
-
No mapping found for HTTP request with URI [/springmvc-1/springmvc/testParamsAndHeaders] in Dispatch
-
vue+No mapping found for HTTP request with URI [*//**] in DispatcherServlet with name ‘springMvc‘
-
异常记录二:寻求解决异常 !No mapping found for HTTP request with URI
-
如何解决“ No mapping found for HTTP request with URI [XXX] in DispatcherServlet with name 'XXX' ”
-
警告: No mapping found for HTTP request with URI [/springmvc-01/helloworld] in DispatcherServlet with
-
No mapping found for HTTP request with URI [/xxx/xxx] in DispatcherServlet with name 'xxx'
-
No mapping found for HTTP request with URI [...] in DispatcherServlet with name ‘DispatcherServlet‘
-
No mapping found for HTTP request with URI [***.html] in DispatcherServlet with name "***"
-
No mapping found for HTTP request with URI [/HelloWeb/] in DispatcherServlet with name 'HelloWeb...
-
No mapping found for HTTP request with URI [/app17a/] in DispatcherServlet with name 'springmvc'解决方法