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"

相关文章:

  • 2022-01-26
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-08
  • 2022-12-23
  • 2021-07-25
  • 2021-05-23
  • 2021-10-23
  • 2021-07-10
相关资源
相似解决方案