在SpringMVC中 /* 和 / 的区别


<url-pattern> / </url-pattern>:会匹配到 /springmvc 这样的路径型url,而不会匹配到像 .jsp 这样的后缀型的url。


<url-pattern> /* </url-pattern>:会匹配到所有的url:路径型url 和后缀型的url (包括/springmvc,.jsp,.js,和.html等)。

在SpringMVC中需要添加这个标签:<mvc:default-servlet-handler /> 用来处理静态资源被“/”所拦截的问题 。

原文地址:https://www.cnblogs.com/tongxuping/p/7134203.html