spring security环境的搭建

2015-10-16 17:55:00
admin
原创
2101
摘要:spring security环境的搭建

spring security环境的搭建:

1.先下载jar包,jar包下载路径见文章http://wanhejia.com/index.php?m=article&f=view&id=13

2.找到dist中的war,修改为rar,并进行解压,然后把它里面的jar放到lib里面。如图所示

然后配置web.xml

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
      <filter-name>springSecurityFilterChain</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>
    <welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
上面是spring的配置,下面是spring security的配置,表示拦截所有的请求

下面整体目录如图所示:

其中messge.properties是实例化用的,

下篇博文介绍applicationContext.xml的配置

    发表评论
    评论通过审核之后才会显示。
    文章分类
    联系方式
    联系人: 郑州-小万
    电话: 13803993919
    Email: 1027060531@qq.com
    QQ: 1027060531
    网址: www.wanhejia.com