2

I have defined two pointcuts in the same classs, one for all the methods and one for the methods in the controller package.

@Pointcut("within(com.myCompany.*)")
public void pointcutAnyMethod() {
    // Pointcut to define any class any package
}

@Pointcut("within(com.myCompany.controller.*)")
public void pointcutControllerMethod() {
    // Pointcut to define any class in the controller package
}

When a method in the controller package is called, the first pointcut is executed first, and the second pointcut is executed second. Is there anyway of altering that order without using a new aspect class? (I've already tried changing the method order and it doesn't work).

I know there's a similar question here: spring annotation advice order

However, that answer only can be applied if you put the pointcuts in two different classes.

Andres
  • 10,561
  • 4
  • 45
  • 63

0 Answers0