当前位置:网站首页>过滤器和拦截器的区别
过滤器和拦截器的区别
2022-07-26 14:28:00 【灬繁花落雨灬】
| 实现原理 | 使用范围 | 触发时机 | 拦截的请求范围 | 注入Bean情况 | 控制执行顺序 | |
|---|---|---|---|---|---|---|
| 过滤器 | 基于回调函数 | 依赖于Tomcat容器,只能在web程序中使用 | 进入Servlet之前 | 对所有进入容器的请求起作用 | 直接就能注入 | @Order控制执行顺序值越小级别越高 |
| 拦截器 | 基于Java的反射机制 | spring中的组件,由Spring容器管理 | 进入Servlet之后,进入Controller之前 | 对Controller中请求或访问static目录下的资源请求起作用 | 需要手动进行注入 | 默认按照注册顺序,也可以通过Order手动设置 |
参考链接:过滤器和拦截器的区别
边栏推荐
- Use of URL download resources
- OLAP (business) - transaction analysis (query)
- 『云原生』KubeSphere可插拔组件之DevOps系统
- How to evaluate the test quality?
- 如何做 APP 升级测试 ?
- 手持振弦采集仪VH03各种接口使用说明
- Sqldeveloper tools quick start
- 基于SPO语义三元组的疾病知识发现
- [dry goods] data structure and algorithm principle behind MySQL index
- maya将模型导入到unity
猜你喜欢

android安全基础知识学习
![[GYCTF2020]FlaskApp](/img/ee/dcb42617af4a0e41657f6cf7095feb.png)
[GYCTF2020]FlaskApp

Maya imports the model into unity

【深度学习】全连接网络

My meeting of OA project

First knowledge of opencv4.x --- image perspective transformation

【无标题】

Instructions for various interfaces of hand-held vibrating wire collector vh03

14. Bridge-Based Active Domain Adaptation for Aspect Term Extraction 阅读笔记
![[Yugong series] July 2022 go teaching course 017 - if of branch structure](/img/e4/b3aa4b8bda738aadded3127a8b3485.png)
[Yugong series] July 2022 go teaching course 017 - if of branch structure
随机推荐
10 schemes to ensure interface data security
android安全基础知识学习
Disease knowledge discovery based on spo semantic triples
Fill in the questionnaire and receive the prize | we sincerely invite you to fill in the Google play academy activity survey questionnaire
【使用工具条绘图】
Job 7.25 sorting and searching
如何做 APP 升级测试 ?
Image-Level 弱监督图像语义分割汇总简析
图神经网络Core数据集介绍
【无标题】
『SignalR』.NET使用 SignalR 进行实时通信初体验
保证接口数据安全的10种方案
我的创作纪念日-从心出发
【整数规划】
Prediction and value evaluation of technology fusion relationship based on multiple features
Focus on building four "highlands" and join hands with partners to build the national cloud!
Would you please refer to the document of Database specification?
Multithreading - thread pool
Redis data operation
Annotation and reflection