过滤器:网络通信模型的会话层控制;

拦截器:事务处理的aop注入(生命周期监控)。

对于Servlet Filter,官方文档中说的很好, 并且给出了常见的应用场景。

A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both. Filters perform filtering in the doFilter method. Every Filter has access to a FilterConfig object from which it can obtain its initialization parameters, and a reference to the ServletContext which it can use, for example, to load resources needed for filtering tasks.

Filters are configured in the deployment descriptor of a web application.

Examples that have been identified for this design are:

  • Authentication Filters
  • Logging and Auditing Filters
  • Image conversion Filters
  • Data compression Filters
  • Encryption Filters
  • Tokenizing Filters
  • Filters that trigger resource access events
  • XSL/T filters
  • Mime-type chain Filter

过滤器和拦截器的执行顺序

https://www.bbsmax.com/A/QW5Y046GJm/

https://my.oschina.net/zdtdtel/blog/3025880

最新文章

  1. HP-UX 11g RAC安装 记录
  2. hibernate配置文件hibernate.cfg.xml和.hbm.xml的详细解释
  3. [Python]记录详细调用堆栈的日志
  4. linux内核增加系统调用--Beginner‘s guide
  5. XMPP框架下微信项目总结(5)花名册获取(好友列表)
  6. Activiti系列:带有serviceTask的或者定时启动任务的流程部署失败的原因分析
  7. Undefined symbols for architecture x86_64 解决之道
  8. 发现js端日期跟php端日期格式不一致
  9. Oracle “CONNECT BY” 使用
  10. 基于u-boot源码的简单shell软件实现
  11. [C#参考]字符编码
  12. Object.prototype.toString & typeof
  13. CMD远程连接服务器上的MySQL
  14. winform中TextBox只能输入字母
  15. (其他)window10上好用的软件
  16. Go Deeper HDU - 3715(2 - sat 水题 妈的 智障)
  17. Cordova 项目 加载不出XML文件
  18. springcloud Eureka学习笔记
  19. 简易ATM机
  20. 动态SQL中 实现条件参数 varchar类型的参数名称 以及模糊查询实现

热门文章

  1. | C语言I作业01
  2. 了解编程语言 ----- c# 简介
  3. jmeter 获取总的线程数
  4. Field "details" doesn't have a default value
  5. Win 10卡顿怎么办?解决win10卡顿的方法大汇总
  6. Java学习:JDBC快速入门
  7. [转]解决ubuntu16.04 ‘E: 无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时不可用) ’ 问题
  8. Java自学-异常处理 Throwable
  9. html5调用手机震动
  10. git https解决免ssL和保存密码