// 配置靜態文件訪問路徑,防止被攔截器攔截 注:**表示匹配該路徑下的全部路徑
<mvc:annotation-driven />
<mvc:resources location="/WEB-INF/static/js/" mapping="/js/**"/>
<mvc:resources location="/WEB-INF/static/images/" mapping="/images/**"/>
<mvc:resources location="/WEB-INF/static/css/" mapping="/css/**"/>
<mvc:resources location="/WEB-INF/static/layer/" mapping="/layer/**"/>
<mvc:resources location="/WEB-INF/static/layui/" mapping="/layui/**"/>css
補上xml頭部引用spring
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">spring-mvc