0
我想指定和建議圍繞在我的API層,它是一組包的所有處理程序:Spring AOP的問題
ox.server.meta.api.v1
ox.server.meta.api.v2
ox.server.meta.api.v2_1
ox.server.meta.api.v2_2
我一直在嘗試下面的代碼:
@Pointcut("@annotation(org.springframework.web.bind.annotation.RequestMapping)")
private void handler() {}
@Pointcut("within(ox.server.meta.api..*)")
private void controller() {}
@Around("handler() && controller()")
public Object aroundAllHandlers(ProceedingJoinPoint pjp) throws Throwable{
...
}
彈簧初始化失敗:
Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at character position 8
handler() && controller()
^
:
java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting 'name pattern' at character position 8
handler() && controller()
任何幫助?我使用的是Spring 3.1.1。