【发布时间】:2017-10-22 20:43:12
【问题描述】:
我应该将 CSS 添加到登录后访问的两个页面,使用 spring security 检查数据
如何将 CSS 添加到受 Spring Security 保护的这两个页面?
task.jsp
<link rel="stylesheet" href="<c:url value=" resources/css/bootstrap.responsive.css" />" type="text/css">
<link rel="stylesheet" href="<c:url value=" resources/css/bootstrap.css" />" type="text/css">
<link rel="stylesheet" href="<c:url value=" resources/css/fontello-ie7.css" />" type="text/css">
<link rel="stylesheet" href="<c:url value=" resources/css/fontello.css" />" type="text/css">
<link rel="stylesheet" href="<c:url value=" resources/css/prettyPhoto.css" />" type="text/css">
<link rel="stylesheet" href="<c:url value=" resources/css/style.css" />" type="text/css">
DispatcherServlet.xml
<mvc:annotation-driven />
<mvc:resources mapping="/resources/**" location="/resources/" />
spring-security.xml
【问题讨论】:
-
css 页面是否也是安全的?如果他们不想受到保护,那么您可以在 spring-security.xml 中删除 css 文件的安全性。
...然后您的应用中的所有页面都可以使用css文件。
标签: java css spring spring-mvc spring-security