2017-07-04 5 views
0

Im erhalte diese Störung taht ich wirklich nicht verstehen:Frühling AOP, ungebunden pointcut Parameter

unbound pointcut parameter auditable 

folgenden Code:

@Aspect 
public class TestAspect { 

    @Before(value = "@annotation(Action)") 
    public void audit(JoinPoint joinPoint, Action auditable) { 
     System.out.println(auditable); 
    } 
} 

@Action(ActionType.FAST) 
    public static void resolveFast(String name){ 
     System.out.println(name); 
    } 

@Retention(RetentionPolicy.RUNTIME) 
@Target(ElementType.METHOD) 
public @interface Action { 

    ActionType value(); 
    boolean withArgs() default false; 
} 

public enum ActionType { 
    FAST, SLOW 
} 

tritt das Problem auf @Before Anmerkung, diese sind meine erste Schritte in aop ...

Antwort

0

try Referenzcode

@Before("execution(public String com.captaindebug.audit.controller.*Controller.*(..)) && @annotation(auditAnnotation)") 
    public void auditScreen(JoinPoint joinPoint,Audit auditAnnotation) {...} 
Verwandte Themen