Spring的application.xml配置模板
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="com.lry.pojo"/> <context:annotation-config/> <aop:aspectj-autoproxy/>
<bean id="diy" class="com.lry.diy.DiyPointCut"/> <bean id="userService" class="com.lry.service.UserServiceImpl"/>
<aop:config>
<aop:pointcut id="pointcut" expression="execution(* com.lry.service.UserServiceImpl.*(..))"/> <aop:advisor advice-ref="beforeLog" pointcut-ref="pointcut"/> <aop:advisor advice-ref="afterLog" pointcut-ref="pointcut"/> </aop:config>
<aop:config> <aop:aspect ref="diy"> <aop:pointcut id="pointCut" expression="execution(* com.lry.service.UserServiceImpl.*(..))"/> <aop:before method="before" pointcut-ref="pointCut"/> <aop:after method="after" pointcut-ref="pointCut"/> </aop:aspect> </aop:config>
</beans>
|