下面这些有什么区别...
@org.aspectj.lang.annotation.Aspect
public class Test {
//@Pointcut, @Around etc etc..
}
和
public aspect Test {
}
什么是更好地用于安全......
- Spring 安全 &
- AOP
在 spring 应用中
最佳答案
检查 here
Aspect declarations are supported by the org.aspectj.lang.annotation.Aspect annotation. The declaration:
@Aspect public class Foo {}
Is equivalent to:
public aspect Foo {}
注意:第一个是spring检测到的。后者需要 AspectJ。
第二个问题。比较是不可能的。因为前者是框架,后者是范式。 Spring Security 使用 AOP 来保护方法调用,AOP 本身并不是一种安全机制。当然,除非您打算使用 AOP 来构建自己的安全性,这是重新发明轮子。
关于java - AOP 与 Spring 安全,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40628120/