AOP/Spring AOP/Filter/Interceptor

AOP

AOP, face-oriented programming, is a programming idea.

Common AOP technology in Java
There are two filters and a proxy mode (also called filters and interceptors), and Filter is based on a callback function.
 The proxy mode is based on Java reflection technology.
 The proxy mode is divided into static proxy and dynamic proxy. Dynamic proxy is a simple implementation of interceptor.
Spring AOP

Spring AOP, an implementation of AOP, uses a proxy mode.

Filter

Filter (filter) is the specification of J2EE, and Servlet 2.3 began to introduce/implement the responsibility chain mode. Filter can be used to set character sets, control permissions, control steering, and more. Filter is also an implementation of AOP.

Interceptor

Interceptor is the concept in Struct2. The same is an implementation of AOP.

Filter and Interceptor contact and difference
1. The interceptor is a java-based reflection mechanism that uses proxy mode, and the filter is based on function callbacks.
 2. The interceptor does not depend on the servlet container, which depends on the servlet container.
 3. Interceptors can only work on actions, and filters can work on almost all requests (you can protect resources).
 4. The interceptor can access the action context, the object inside the stack, and the filter is not.

 5. Execution order: before filtering - intercepting money - Action processing - after interception - after filtering.

Intelligent Recommendation

The difference between Spring MVC filter, interceptor and AOP

The difference between Spring MVC filter, interceptor and AOP Filter The filter intercepts web access url addresses. Strictly speaking, the filter is only applicable to the web, relying on the Servlet...

Spring learning Filter, Interceptor, AOP implementation and distinction

AOP is mainly dynamic proxy, the main use of the filter is the function callback; the interceptor is used as a reflex mechanism. A request, advance the filter processing, see if the program accepts th...

Review the differences between Spring Aop, interceptor, and filter

explain Spring AOP: It is an implementation of AOP, using the proxy mode. Filter: Filter can be used to set character sets, control permissions, control steering, etc. Filter is also an implementation...

Spring MVC: filter filter, interceptor interceptor, AOP difference

Filter filter The filter intercepts the web access url address. Strictly speaking, filter is only applicable to the web, relying on the Servlet container, and using Java's callback mechanism. Intercep...

Spring: Filter FILTER, Interceptor Interceptor, and AOP Differences and Contact

Filter filter The filter intercepts the Web Access URL address. Strictly speaking, FILTER is only suitable for use in the Web, depending on the servlet container, using Java's callback mechanism. Filt...

More Recommendation

Filter (Filter), interceptor (Interceptor), for distinguishing section AOP

Filter (Filter), interceptor (Interceptor), facing the section (AOP) to distinguish Along the way to the filter (Filter), interceptor (Interceptor), AOP some doubts, always feel hard to tell, especial...

Filter, Interceptor, AOP Differences and Instances

filter interceptor aspect Entering ServletRequest, ServletResponse HttpServletRequest , HttpServletResponse , Object handler ProceedingJoinPoint principle Depends on the servlet container, independent...

SpringBoot the filter, listener, interceptor, AOP

Filter under SpringBoot Listener under SpringBoot Interceptor under ## SpringBoot Interceptor type HandlerInterceptorAdapter need to inherit and configure the interceptor type of configuration @Config...

Implementation and difference of filter, interceptor, and aop

Foreword In projects, we often need to intercept RESTful api. The mainstream implementation methods include filter, interceptor, and aop. Let me talk about their respective implementations. Filter Ani...

Request to intercept FILTER, Interceptor, AOP

Article catalog 1 scene 2 difference 3 request order 4 version 4.1 MAVEN Dependent 4.2 Test Controller 5 Filter code implementation 5.1 Description 5.2 definition 5.3 test 5.4 Configuration Order 6 Ha...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top