简体   繁体   English

Spring拦截器与servlet过滤器

[英]Spring interceptor vs servlet filter

Spring拦截器比servlet过滤器有什么优势?

  • You can inject other beans in the interceptor 你可以在拦截器中注入其他bean
  • You can use more advanced mapping patterns (ant-style) 您可以使用更高级的映射模式(ant-style)
  • You have the target handler object (controller) available, as well as the result ModelAndView 您可以使用目标处理程序对象(控制器)以及结果ModelAndView
  • It is a bean, so you can use AOP with it (althoug that would be rare) 它是一个bean,所以你可以使用AOP(虽然很少见)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM