更新时间:2022-03-18 23:17:14
我认为问题在于您的 web.xml
仅将 *.html
请求映射到您的servlet,并且您正在向它发送一个没有 .html
后缀的请求.
I think that the problem is that your web.xml
only maps *.html
requests to your servlet, and you are sending it a request without a .html
suffix.
一种解决方案是更改 servlet 映射.例如
One solution is to change the servlet mapping. For example
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.</url-pattern>
</servlet-mapping>
匹配任何后缀,或
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
匹配任何路径.