我用的这种,其中css文件夹和jsp文件同目录

<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/timeline.css" charset="UTF-8"/>

普通的web项目检查web.xml

其他类型静态文件自行补充

<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.css</url-pattern>
  </servlet-mapping>

题目的情况检查springmvc的配置文件

放行所用静态资源

<mvc:resources mapping="/css/**" location="/css/"></mvc:resources>

如若无效果,清除编译缓存并重启

相关文章:

  • 2022-01-21
  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
  • 2018-08-17
  • 2022-12-23
  • 2021-09-19
猜你喜欢
  • 2021-05-26
  • 2021-11-01
  • 2022-12-23
  • 2021-07-02
  • 2021-10-22
  • 2021-12-03
  • 2021-11-19
相关资源
相似解决方案