springmvc中url-pattern的大坑

 1 <servlet>

 2         <servlet-name>springmvc</servlet-name>

 3         <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

 4         <load-on-startup>1</load-on-startup>

 5     </servlet>

 6     <servlet-mapping>

 7         <servlet-name>springmvc</servlet-name>

 8         <!-- 切记不能是<url-pattern>/</url-pattern>,否则报404 -->

 9         <url-pattern>/*</url-pattern>

10     </servlet-mapping>

本人愚钝,切勿吐槽,愿与君共勉之!

你可能感兴趣的:(url-pattern)