部分 I. 基础篇

在一开始,我们主要谈谈怎么配置Spring Security,怎么使用Spring Security。

为了避免在每个例子中重复包含所有的第三方依赖,要知道Spring.jar就有2M多,所以我们使用了Maven2管理项目。如果你的机器上还没安装Maven2,那么可以参考我们网站提供的Maven2教程http://www.mossle.com/docs/maven2/html/index.html

我们用使用的第三方依赖库关系如下所示:

[INFO] [dependency:tree]
[INFO] com.mossle.springsecuritybook:ch001:war:1.0
[INFO] \- org.springframework.security:spring-security-taglibs:jar:3.1.3.RELEASE:compile
[INFO]    +- org.springframework.security:spring-security-core:jar:3.1.3.RELEASE:compile
[INFO]    |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO]    +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile
[INFO]    |  \- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile
[INFO]    +- org.springframework.security:spring-security-acl:jar:3.1.3.RELEASE:compile
[INFO]    |  +- org.springframework:spring-jdbc:jar:3.0.7.RELEASE:compile
[INFO]    |  \- org.springframework:spring-tx:jar:3.0.7.RELEASE:compile
[INFO]    +- org.springframework:spring-web:jar:3.0.7.RELEASE:compile
[INFO]    +- org.springframework.security:spring-security-web:jar:3.1.3.RELEASE:compile
[INFO]    +- org.springframework:spring-core:jar:3.0.7.RELEASE:compile
[INFO]    +- org.springframework:spring-context:jar:3.0.7.RELEASE:compile
[INFO]    +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile
[INFO]    \- org.springframework:spring-expression:jar:3.0.7.RELEASE:compile