使用SpringMVC的时候,如果在web.xml文件中设置url-pattern为/的话,那么当引入一个js文件,css文件等请求会被SpringMVC所拦截,导致文件不能引入,可以更改url-pattern,使其为特定的后后缀(如.do,.html等),除此之外,SpringMVC提供了一个标签,可以让SpringMVC不是拦截这个请求
这个标签是<mvc:resource>
首先,要使用这个标签,要在SpringMVC的xml文件上注明,如下
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocatio