1. Introduction 在 application context 中,你的开始使用 security 命名
空间,必须在 application context 文件中添加 schema 声明。 Java 代码
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
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-2.0.2.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.2.xsd">
...
</beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:security="http://www.springframework.org/schema/security"
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-2.0.2.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.2.xsd">
...
</beans>如果把 spring security 配置文件单独配置在一个文件,可以把
security 命名空间设置为默认的,以简化配置。更改 beans tag 的 配饰,如下:
引用
<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-2.0.xsd
http://www.springframework.org/schema/security
http://www.springframeworrk.org/schema/security/spring-security-2.0.1.xsd">
2.1.1. Design of the Namespace
Web/HTTP Security
Business Object (Method) Security
AuthenticationManager
AccessDecisionManager
AuthenticationProviders
UserDetailsService
2.2. Getting Started with Security Namespace Configuration
2.2.1. web.xml Configuration 首先在 app 的 web.xml 文件中添加下面
的过滤器声明:
2.2.2. A Minimal <http> Configuration 启用 web security 从一下配置
开始: Java 代码
评论0
最新资源