Hello all,
I think I am close to hacking together a really simple AOP example but its not quite working. Here is my aspect class:
Code:@Aspect public class SystemArchitecture { @Pointcut("execution(public * *(..))") public void businessService() { System.out.println("Hello World!"); } }
In my XML file:
Code:<aop:aspectj-autoproxy/> <bean id="systemArchitecture " class="aop.SystemArchitecture"/> <bean id="service" class="service.ServiceImp" /> <bean id="springappController" class="web.SpringappController"> <property name="commandName"><value>command</value></property> <property name="commandClass"><value>command.HelloCommand</value></property> <property name="formView"><value>hello.jsp</value></property> <property name="successView"><value>hello.jsp</value></property> <property name="service"> <ref bean ="service"/> </property> </bean>
In my controller I have a call to a method in the service.Service class called sayHello.
The small app is building and deploying fine but the pointcut method is not firing even though I thought it should for ANY pulic method because of this line:
@Pointcut("execution(public * *(..))")
What am I missing? I figure its something in the XML file.
I pretty much took the examples in the documentation and hacked it into a small web app. Any ideas?


Reply With Quote