Spring培训.ppt
- 格式:ppt
- 大小:154.51 KB
- 文档页数:33
Spring Security 3.x 出来一段时间了,跟Acegi是大不同了,与2.x的版本也有一些小小的区别,网上有一些文档,也有人翻译Spring Security 3.x的guide,但通过阅读guide,无法马上就能很容易的实现一个完整的实例。
我花了点儿时间,根据以前的实战经验,整理了一份完整的入门教程,供需要的朋友们参考。
1,建一个web project,并导入所有需要的lib,这步就不多讲了。
2,配置web.xml,使用Spring的机制装载:<?xml version="1.0" e ncoding="UTF-8"?><web-app version="2.4" xmlns="/xml/ns/j2ee"xml ns:xsi="/2001/XMLS chema-i nstance"xsi:s chemaLocation="http://java.s /xml/ns/j2eehttp://java.s /xml/ns/j2ee/web-app_2_4.xsd"><conte xt-param><param-name>contextConfi gLocation</param-name><param-val ue>classpath:applicationConte xt*.xml</param-value></conte xt-param><listener><listener-class>org.springframework.we b.conte xt.Context LoaderListener</listener-class></listener><filter><filter-name>springSecurityFilterChain</filter-name><filter-class>org.springframework.we b.filter.DelegatingFilterProxy</filter-class></filter><filter-mappi ng><filter-name>springSecurityFilterChain</filter-name><url-pattern>/*</url-pattern></filter-mapping><w elcome-file-list><wel come-file>l ogin.jsp</wel come-file></welcome-file-list></we b-app>这个文件中的内容我相信大家都很熟悉了,不再多说了。