<filter>
<filter-name>secondDomainFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<init-param>
<param-name>targetFilterLifecycle</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>secondDomainFilter</filter-name>
<url-pattern>*.htm</url-pattern>
</filter-mapping>
<filter>
<filter-name>shopFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
<init-param>
<param-name>targetFilterLifecycle</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>shopFilter</filter-name>
<url-pattern>*.htm</url-pattern>
</filter-mapping>

spring-web 炸包下面的这个代理类主要作用如下:

使filter可以使用spring中的bean,达到可插拔的效果。比如你可以使用shiro或者springSecurity等安全框架来进行权限管理,这样也算是使安全验证这一块与spring解耦。

具体过程:web.xml中的ContextLoaderListener会将spring及你使用的shiro或者springSecurity的相关配置文件加载,然后初始化声明的bean,这其中就有filter中要用到的bean;这样filter用到这些bean的时候就可以到spring的bean容器中去取了

DelegatingFilterProxy作用浅析的更多相关文章

  1. C++中虚函数的作用浅析

    虚函数联系到多态,多态联系到继承.所以本文中都是在继承层次上做文章.没了继承,什么都没得谈. 下面是对C++的虚函数这玩意儿的理解. 一, 什么是虚函数(如果不知道虚函数为何物,但有急切的想知道,那你 ...

  2. linux/unix下 pid文件作用浅析

    l在linux系统的目录/var/run下面一般我们都会看到很多的*.pid文件.而且往往新安装的程序在运行后也会在/var/run目录下面产生自己的pid文件.那么这些pid文件有什么作用呢?它的内 ...

  3. Linux/Unix下pid文件作用浅析

    转载:http://blog.csdn.net/changli_90/article/details/8911191 在Linux系统的目录/var/run下面一般我们都会看到很多的*.pid文件.而 ...

  4. yii2-cache组件第三个参数Dependency $dependency的作用浅析

    用法如下: $cache->set($key, $result, Configs::instance()->cacheDuration, new TagDependency([ 'tags ...

  5. shiro权限框架(五)

    五.与Spring集成 5.1 环境准备 <dependency> <groupId>org.apache.shiro</groupId> <artifact ...

  6. Shiro详解

    Shiro Shiro集成Spring 加入Spring和Shiro的jar包 配置Spring及SpringMVC 参照:官方给出的案例shiro\samples\spring Shiro集成Web ...

  7. Shiro笔记(二)Shiro集成SpringMVC的环境配置

    0.pom文件引入 <!-- SECURITY begin --> <dependency> <groupId>org.apache.shiro</group ...

  8. shiro框架

    Shiro Shiro简介 SpringMVC整合Shiro,Shiro是一个强大易用的Java安全框架,提供了认证.授权.加密和会话管理等功能. Authentication:身份认证/登录,验证用 ...

  9. web中集成shiro

    Shiro提供了与Web集成的支持,其通过一个ShiroFilter入口来拦截需要安全控制的URL,然后进行相应的控制,ShiroFilter类似于如Strut2/SpringMVC这种web框架的前 ...

随机推荐

  1. python第一百三十天 ---简单的BBS论坛

    简单的BBS论坛 实现功能 git仓库地址:https://github.com/uge3/BBS 1.整体参考“抽屉新热榜” + “博客园” 2.实现不同论坛版块 3.帖子列表展示 4.个人博客主页 ...

  2. Android Studio移除模块

    一.打开文件菜单下的项目结构 二.在项目结构中选中模块,点击-号,然后删除 三.删除本地文件,移除模块成功

  3. 函数指针的返回值是指针数组,数组里放的是int;函数指针的返回值是指针数组,数组里放的是int指针

    函数指针的返回值是指针数组,数组里放的是int 函数指针的返回值是指针数组,数组里放的是int指针 #include <stdio.h> #include <stdlib.h> ...

  4. python中的猴子补丁Monkey Patch

    python中的猴子补丁Monkey Patch 什么是猴子补丁 the term monkey patch only refers to dynamic modifications of a cla ...

  5. TestFlight的使用--再也不用担心环境打错了

    转赞请注明出处:http://www.cnblogs.com/zhanggui/p/7039651.html 一.前言 在iOS开发过程中,难免会遇到各种Bug.因此你会去解决所有的Bug,然后提交到 ...

  6. HIVE配置错误信息

    原因:版本问题 解决方法:cp /root/hive/lib/当前的jlinexx.jar /root/hadoop/share/hadoop/yarn/lib

  7. (转)Spring Boot (十四): Spring Boot 整合 Shiro-登录认证和权限管理

    http://www.ityouknow.com/springboot/2017/06/26/spring-boot-shiro.html 这篇文章我们来学习如何使用 Spring Boot 集成 A ...

  8. nginx作为负载均衡服务器,tomcat作为应用服务器

    1 如果想用一台主机,能够部署多个站点,并且访问每个站点都要求是在80端口,可以采用nginx+tomcat的方式 需要注意的是,tomcat一定不要监听80端口.   可以将静态资源配置在nginx ...

  9. UVA437-The Tower of Babylon(动态规划基础)

    Problem UVA437-The Tower of Babylon Accept: 3648  Submit: 12532Time Limit: 3000 mSec Problem Descrip ...

  10. 根据JavaBean创建数据库的操作SQL

    根据JavaBean创建数据库的操作SQL import java.lang.reflect.Field; public class GenerateSQL { public static void ...