Thursday, 5 September 2013

Spring AOP problems

Spring AOP problems

I would like to specify and advice around all handlers in my API layer,
which is the set of packages:
ox.server.meta.api.v1
ox.server.meta.api.v2
ox.server.meta.api.v2_1
ox.server.meta.api.v2_2
I've been trying the following code:
@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{
...
}
Spring initialization fails with:
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()
Any help? I'm using Spring 3.1.1.

No comments:

Post a Comment