title: Aspect not executed in Spring
body: <p>I'm coding a website that will be almost fully protected by login (I'm using Spring Security for it). There are certain pages that are not protected, though (home page, login page, registration page, forgotten password page, ...) and what I'm trying to achieve is:</p>
  
  <ul>
  <li>If the user is not logged in when accessing these non-secured pages,
  show them normally</li>
  <li>If the user is already logged in, redirect to the
  home page (or to the page specified in the <code>redirectTo</code> annotation element)</li>
  </ul>
  
  <p>Of course I want to avoid to put this in every single controller method:</p>
  
  <pre><code>if(loggedIn())
  {
      // Redirect
  }
  else
  {
      // Return the view
  }
  </code></pre>
  
  <p>And for this reason I would like to use AOP.</p>
  
  <p>I created the Annotation <code>@NonSecured</code> and I coded the following Aspect:</p>
  
  <pre><code>@Aspect
  public class LoggedInRedirectAspect
  {
      @Autowired
      private UserService userService;
  
      @Around("execution(@my.package.annotation.NonSecured * *(..))")
      public void redirect(ProceedingJoinPoint point) throws Throwable
      {
          System.out.println("Test");
          point.proceed();
      }
  }
  </code></pre>
  
  <p>Example annotated method:</p>
  
  <pre><code>@Controller
  @RequestMapping("/")
  public class HomeController
  {
      @NonSecured(redirectTo = "my-profile")
      @RequestMapping(method = RequestMethod.GET)
      public String index(Model model,
                          HttpServletRequest request) throws Exception
      {
          // Show home page
      }
  }
  </code></pre>
  
  <p>applicationContext.xml important bits:</p>
  
  <pre><code>&lt;context:annotation-config /&gt;
  &lt;context:component-scan base-package="my.package" /&gt;
  
  &lt;tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" /&gt;
  
  &lt;bean id="loggedInRedirectAspect" class="my.package.aspect.LoggedInRedirectAspect" /&gt;
  &lt;aop:aspectj-autoproxy proxy-target-class="true"&gt;
      &lt;aop:include name="loggedInRedirectAspect" /&gt;
  &lt;/aop:aspectj-autoproxy&gt;
  </code></pre>
  
  <p>The problem is that the method <code>redirect(...)</code> in the aspect never gets called. <s>Aspects in general are working fine, in fact the following method in the aspect will get called:</s> The following advice gets called but doesn't get called for the controller methods.</p>
  
  <pre><code>@Around("execution(* *(..))")
  public void redirect(ProceedingJoinPoint point) throws Throwable
  {
      point.proceed();
  }
  </code></pre>
  
  <p>Am I doing something wrong in my pointcut?</p>
  
  <p>Thank you.</p>
  
  <p><strong>Update:</strong> the last snippet in this question gets called but still doesn't get called for the controller methods.</p>