1.在WebRoot目录下创建 resources文件,里面可以放入css文件
2.在SpringMVC中的配置文件dispatcherServlet-servlet.xml中加入
<!-- 将静态文件指定到某个特殊的文件夹中统一处理 -->
<mvc:resources mapping="/resources/**" location="/resources/" />
3.在需要的jsp页面加入link标签
<!--<%=request.getContextPath()%>:获取当前的系统路径并输出在页面上-->
<link rel="stylesheet" href="<%=request.getContextPath()%>/resources/css/main.css" type="text/css"