【发布时间】:2014-06-05 04:17:44
【问题描述】:
我正在使用 spring security 3.0 。在 spring-security.xml 中,显示登录页面时出现 1 个问题。 Web 浏览器中未加载或丢失 CSS 的 login.jsp。所以请解决这个问题..我感谢你的任何帮助。
我的 spring-security.xml 代码如下..
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.3.xsd">
<http auto-config="true" use-expressions="true">
<intercept-url pattern="/login.html" access="permitAll" />
<intercept-url pattern="/logout" access="permitAll" />
<intercept-url pattern="/accessdenied" access="permitAll" />
<intercept-url pattern="/**" access="hasRole('ROLE_USER')" />
<form-login login-page="/login.html" default-target-url="/firstwelcome.html" />
<logout logout-success-url="/logout" />
</http>
<authentication-manager alias="authenticationManager">
<authentication-provider>
<password-encoder hash="md5"/>
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query="
SELECT strUSERNAME, strPASSWORD, CASE blENABLED WHEN 1 THEN 'true' ELSE 'false' END 'ENABLED'
FROM TBLUSERS
WHERE strUSERNAME=?;"
authorities-by-username-query="
SELECT strUSERNAME, strROLENAME
FROM TBLUSERS
WHERE strUSERNAME=?;"
/>
</authentication-provider>
</authentication-manager>
</beans:beans>
我的 login.jsp 的标题如下所示
<link rel="stylesheet" type="text/css" href="css/login.css">
在上面的 login.jsp 中使用链接标签来调用 css.. 但不幸的是没有调用..``.plz...帮助我调用login.css文件。 我感谢你的任何帮助。
谢谢
【问题讨论】:
-
发布您的项目结构
-
在 web-content 文件夹 1)css 2)images 2) Meta-INF 3) WEB-INF ..IN CSS 文件夹 login.css WEB-INF 文件夹 IN 1)JSP 2)LIB 3) springservlet.xml 4)springsecurity.xml
-
正如您在
web-inf中看到的那样,为什么不在您的路径之前尝试./呢? -
in ?
-
是的。这会加载吗?
标签: spring jsp spring-security resources loading