Loading...
「ツール」は右上に移動しました。
利用したサーバー: natural-voltaic-titanium
4いいね 105回再生

Spring AOP Pointcuts Demystified in 60 Sec

Spring AOP pointcut (Defines where aspects get applied within your application - location shower)

@Aspect
@Component
public class MyPointcut {

@Pointcut("execution(* com.example.service.*.save*(..))")
public void saveMethods() {}
}

@Aspect
@Component
public class LoggingAspect {

@Before("MyPointcut.saveMethods()") // Apply before the pointcut
public void logSaveOperation(JoinPoint joinPoint) {
System.out.println("Logging before saving something with: " + joinPoint.getSignature().getName());
}
}

#FabianTechSolutions #DevTeam

コメント