spring security环境搭建

本文通过代码给大家介绍了spring security环境搭建的详细教程,非常不错,具有参考借鉴价值,需要的朋友参考下吧

目前Spring官方只提供Maven的下载方式。但在http://maven.springframework.org中有SpringSecurity及其他所有Spring产品的下载方式。

http://maven.springframework.org/release/org/springframework/中有Spring相关的所有下载,但好像直到3.2版的,最新的版本在这个里面找不到

http://maven.springframework.org/release/org/springframework/security/spring-security/3.2.0.RELEASE/这个是SpringSecurity3.2的下载地址

Maven下载地址:

org.springframework.securityspring-security-web3.2.0.RELEASEOrg.springframework.securityspring-security-config3.2.0.RELEASE

本教程是基于SpringMVC3.2+Hibernate4+JPA2.0+SpringSecurity3.2的环境。SpringMVC3.2+Hibernate4+JPA2.0环境的搭建在这里就不多说了,主要讲下SpringSecurity的环境搭建

web.xml配置

contextConfigLocation classpath:applicationContext.xml, classpath:applicationContext-security.xml springSecurityFilterChainorg.springframework.web.filter.DelegatingFilterProxyspringSecurityFilterChain/*

applicationContext-security.xml命名空间配置,官方提供了两种配置方案

第一种、命名空间用beans开头,但是在配置中一直需要用来配置。

...

第二种、命名空间用security开头,在配置中不需要security前缀,但是bean的配置需要用配置。

...

到此为止SpringSecurity的环境配置已基本完成

命名空间的配置可在spring的官方文档,第4章 Security Namespace Configuration 中找到,一下附上链接地址

http://docs.spring.io/spring-security/site/docs/3.2.0.RELEASE/reference/htmlsingle/#ns-config

总结

相关文章

HashMap是Java中最常用的集合类框架,也是Java语言中非常典型...
在EffectiveJava中的第 36条中建议 用 EnumSet 替代位字段,...
介绍 注解是JDK1.5版本开始引入的一个特性,用于对代码进行说...
介绍 LinkedList同时实现了List接口和Deque接口,也就是说它...
介绍 TreeSet和TreeMap在Java里有着相同的实现,前者仅仅是对...
HashMap为什么线程不安全 put的不安全 由于多线程对HashMap进...