Spring 应用中责任链设计模式(过滤器/拦截器)应用总结

  1. Java Servlet : 1 FilterChain = n Filter + 1 Servlet
  2. Spring MVC : 1 HandlerExecutionChain = n HandlerInterceptor + 1 handler
  3. Spring MVC : 1 RequestResponseBodyAdviceChain =m RequestBodyAdvice + n ResponseBodyAdvice
  4. Spring AOP : 1 Proxy = n MethodInterceptor + 1 target bean

参考资料

  • Chain of Responsibility
  • Interpreter Design Pattern
  • 拦截器和过滤器的区别
  • 过滤器(Filter)与拦截器(Interceptor )区别

你可能感兴趣的:(spring,architecture)