Tag:Tangent point

  • AOP pointcut expression — within expression, execution () expression

    Time:2022-2-14

      Support tangent identifier Spring AOPThe following AspectJ pointcut identifiers (PCDs) are supported for pointcut expressions: Execution: used to match the method execution connection point. This is the primary pointcut identifier used when using spring AOP. It can be matched to the method level, fine-grained Within: it can only match the class level, and can only […]

  • Springboot uses AOP to output the corresponding request log, and supports the output of parameters in @ requestbody

    Time:2022-2-8

    Add dependency Add spring boot starter AOP dependencies as appropriate. Configure AOP section Common annotation functions:@Aspect: declare this class as an annotation class;@Pointcut: define a tangent point followed by an expression. The expression can be defined as a method under a package or a user-defined annotation;After the cut point is defined, the article will focus […]

  • AOP concept

    Time:2022-1-10

    The first in the spring AOP series Let’s first introduce some concepts related to AOP. Emerging opportunities In reality, we often need to record the flow of important operations and print relevant logs to log files // WeChat official account: CoderLi public class BizService01 { public void dealBiz(BizDto bizDto) { //Desensitization printing + statistical check-in […]

  • Spring framework common annotations

    Time:2022-1-5

    1. Annotation of declared [email protected]: declares that the class is a component and has no explicit role @Service: used to label business logic layer components (i.e. service layer) @Repository: used to label data access components (Dao layer), @Controller: used in the control layer to declare the return view @Restcontroller: used in the control layer to […]

  • Interceptor, a plug-in mechanism of springboot + mybatis series

    Time:2021-12-24

    [springboot + mybatis series] plug-in mechanism interceptor In mybatis, the plug-in mechanism provides a very powerful extension capability. Before the final execution of SQL, it provides four interception points to support function expansion in different scenarios Executor (update, query, flushStatements, commit, rollback, getTransaction, close, isClosed) ParameterHandler (getParameterObject, setParameters) ResultSetHandler (handleResultSets, handleOutputParameters) StatementHandler (prepare, parameterize, batch, […]

  • Getting started with spring AOP

    Time:2021-11-20

    There are many tutorials about the principle of AOP on the Internet, which will not be repeated here, but how to use it through specific cases. 1、 Introductory case First fromstart.spring.ioDownload a spring boot project from. You only need to introduce web dependencies. Then we create a controller: @RestController public class HelloController { /*@AspectAction(name = […]

  • [October 20] spring framework learning

    Time:2021-9-7

    Enterprise applications Modern enterprise application is an application that takes web server as the center and connects server and client browser through network. Web support Internet based (web browser) High concurrency support At the same time, it receives a large number of HTTP requests, and the system needs to respond quickly Transaction support Support transaction […]

  • [Online troubleshooting practice] do you really understand the execution sequence of AOP

    Time:2021-8-16

    preface Busy is my main theme this month, and it is also the interface of my frequent pigeon articles – quite three knives The company has launched a new project in the past two months. The project schedule is full, but we still have to learn when we should learn. No, I stepped into a […]

  • Some problems in using spring AOP

    Time:2021-7-29

    I have encountered some problems when using AOP. I hereby record it First write a commonly used AOP slice Slice class aoplog package com.mantis.aop.aspect; import com.fasterxml.jackson.databind.ObjectMapper; import com.mantis.aop.common.util.DataUtil; import eu.bitwalker.useragentutils.UserAgent; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import org.springframework.validation.BeanPropertyBindingResult; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import […]

  • Android kotlin uses annotations to realize the anti button connection function

    Time:2021-7-29

    SingleClick: @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.FUNCTION) annotation class SingleClick( //Click interval, MS val value: Long = 500 ) SingleClickAspect: import android.os.SystemClock import org.aspectj.lang.ProceedingJoinPoint import org.aspectj.lang.annotation.Around import org.aspectj.lang.annotation.Aspect import org.aspectj.lang.annotation.Pointcut import org.aspectj.lang.reflect.MethodSignature @Aspect class SingleClickAspect { /** *Define the tangent point and mark the tangent point as all the methods annotated by @ singleclick *Note: here, me.baron.test.annotation.singleclick needs to […]

  • Detailed interpretation of aspect oriented programming in spring AOP (2)

    Time:2021-7-5

    This article is the sequel of “a detailed interpretation of aspect oriented programming in spring AOP (1)”. In the first part, we go from writing dead code to using proxy; From programming   Spring AOP to declarative spring AOP. Everything is developing in the direction of simple pragmatism. Along the direction of spring AOP, rod […]

  • Analysis of key and difficult points of spring AOP

    Time:2021-4-30

    Analysis of key and difficult points What is AOP, what problems are solved, and application scenarios? What is it? AOPAspect oriented programming can enhance the function of the code without changing the original code. What problems have been solved? AOP is mainly used to solve: without changing the original business logic, enhance the crosscutting logic […]