I have this working code for a specific package, but i want to configure it for all controllers, service and dao packages Eg>
How about one of these alternatives?
A) General execution pointcut with package restrictions:
execution(* *(..)) &&
(
within(com.abc.xyz..controller..*) ||
within(com.abc.xyz..service..*) ||
within(com.abc.xyz..dao..*)
)
B) Package-restricted execution pointcuts:
execution(* com.abc.xyz..controller..*(..)) ||
execution(* com.abc.xyz..service..*(..)) ||
execution(* com.abc.xyz..dao..*(..))
I prefer B, by the way, just because it is a bit shorter and easier to read. As you have probably guessed, the ..
notation means "any package or subpackage", whereas *
at the end of the expression after ..
means "any method in any class".