那一定是你web.xml中写了过滤器
或者springmvc.xml写了静态过滤
<!-- 启用tomcat默认servlet处理静态资源 -->
<mvc:default-servlet-handler/>
<!-- 开启注解驱动 -->
<mvc:annotation-driven />
<!-- 解决js、css、img失效问题 -->
<mvc:resources mapping="/js/**" location="/js/"/>
<mvc:resources mapping="/css/**" location="/css/"/>
<mvc:resources mapping="/fonts/**" location="/fonts/"/>
<mvc:resources mapping="/font-awesome/**" location="/font-awesome/"/>
jsp界面
js,css,img失效
可以看到like标签中有内容
文件中也有内容
要解决这个问题需要在原来的基础上加上
<mvc:resources mapping="/js/**" location="/js/"/>
<mvc:resources mapping="/css/**" location="/css/"/>
<mvc:resources mapping="/fonts/**" location="/fonts/"/>
<mvc:resources mapping="/font-awesome/**" location="/font-awesome/"/>
<mvc:resources mapping="/layui/**" location="/layui/"/>
<mvc:resources mapping="/layer/**" location="/layer/"/>
mapping表示映射,location表示位置
<mvc:resources mapping="/layui/**" location="/layui/"/>的写法是更据自己的文件结构来的
mapping="/layui/**"映射layui小的所有文件
location="/layui/"表是layui文件
查询文件是他会自动补齐"/"前后内容