Announcement Announcement Module
Collapse
No announcement yet.
Aspect not always intercepting Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Aspect not always intercepting

    I have several servlets in my project. Each with it's own set of controllers. Each servlet starts with this:
    Code:
     <context:annotation-config />
        <mvc:annotation-driven/>
        <context:component-scan base-package="xxx.yyy.zzz.controllers" />
        <aop:aspectj-autoproxy proxy-target-class="true"/>
        
        <bean class="xxx.yyy.spring.logging.aspect.AspectLogging" />
    The aspect logging looks like this:
    Code:
    @Aspect
    public class AspectLogging
    {
       @Pointcut("@annotation(org.springframework.web.bind.annotation.RequestMapping)")
       public void RequestMappingPointcut()
       {
       }
    
       @Around(value = "RequestMappingPointcut() && @annotation(requestMapping)", argNames = "requestMapping")
       public Object doLogging(ProceedingJoinPoint pjp, RequestMapping requestMapping) throws Throwable
       {
    ...
    For some reason the interception works for some servlets but not all. Where would I even begin to look for the solution? Is there some Spring class I can put a breakpoint in to test? I'm at a loss here...
Working...
X