<bean id="userServiceImpl" class="com.bj.aop.xml.before.UserServiceImpl"></bean> <bean id="security" class="com.bj.aop.xml.before.Security"></bean> <aop:config> <aop:aspect id="aa" ref="security"> <aop:pointcut expression="execution(* *.saveUser*(..))" id="save"/> <aop:pointcut expression="execution(void com.bj.aop.xml.before.UserServiceImpl.updateUser(java.lang.String, java.lang.String))" id="update"/> <aop:before method="checkSecurity" pointcut-ref="save"/> <aop:before method="checkSecurity" pointcut-ref="update"/> </aop:aspect> </aop:config>
原文:http://www.cnblogs.com/baijin05/p/5056943.html