【发布时间】:2016-09-25 08:55:38
【问题描述】:
我无法将 css 链接到 JSP 页面 -
项目结构:
webapp
resources
css
bootstrap-iso.css
WEB-INF
views
jsp
app.jsp
jsp文件中的以下代码有效:
<link rel="stylesheet" href="https://formden.com/static/cdn/bootstrap-iso.css"/>
但是,当我给出以下任何一个时它都不起作用
<link rel="stylesheet" href="../../../resources/css/bootstrap-iso.css"/>
<link rel="stylesheet" href="/resources/css/bootstrap-iso.css"/>
我还在 ApplicationConfig 文件中设置了资源处理程序
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
}
【问题讨论】:
标签: css spring jsp spring-mvc