0

here i am using a point cut annotation as follows:


    @Pointcut("Execution(* com.luv2code.springdemo.controller.*.*(..))")
    private void forControllerPackage() {
        
    }

it giving me an exception which is as:

Pointcut is not well-formed: expecting ')' at character position 12
Execution(* com.luv2code.springdemo.dao.*.*(..))
            ^^^                                

I have just started learning AOP any suggestion or help is going to help a lot thanks.

Ali Raza
  • 41
  • 1
  • 6
  • Hi Please have look of this thread, this might help you. https://stackoverflow.com/questions/25992277/aspectj-pointcut-for-all-methods-inside-package/26005838 – Raushan Kumar Feb 01 '22 at 06:20

1 Answers1

0

You need to spell execution in all lower-case characters:

@Pointcut("execution(* com.luv2code.springdemo.controller.*.*(..))")
private void forControllerPackage() {}

BTW, if you want to make sure that subpackages of com.luv2code.springdemo.controller are also covered, please use the .. syntax as follows:

@Pointcut("execution(* com.luv2code.springdemo.controller..*(..))")
private void forControllerPackage() {}
kriegaex
  • 63,017
  • 15
  • 111
  • 202