0
votes

I had created a pointcut. But it is not working. Please assist me on the below code. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd ">

<aop:aspectj-autoproxy />

<bean id="customerBo" class="com.mkyong.customer.bo.impl.CustomerBoImpl" />

<!-- Aspect -->
<bean id="logAspect" class="com.mkyong.aspect.LoggingAspect" />

https://pastebin.com/Qi0cJkJJ

2
Please refer to pastebin link for the entire code: (pastebin.com/Qi0cJkJJ)srini s

2 Answers

0
votes

Does it make any sense to XML-configure the aspect bean as LoggingAspect and then call your aspect class MyAspect?

0
votes

I think your problem is in the pointcut definition. You use

 @Pointcut("within(com.mkyong.customer.bo.*)")
 public void checkMyDetails() {}

but to define a pointcut in a package and all its subpackages (in your case: the implementation package), the syntax would be

 @Pointcut("within(com.mkyong.customer.bo..*)")
 public void checkMyDetails() {}

Note the two dots: bo..* instead of bo.*