我想围绕我的 API 层中的所有处理程序指定和建议,这是一组包:
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。