You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- 1. 配置原生前置通知类 -->
<bean id="logAdvice" class="com.ssm.aop.xml.aspect.Log"/>
<!-- 2. 配置目标实体类每人在这里加自己的实体bean -->
<bean id="categoryTarget" class="com.ssm.aop.xml.entity.Category">
<constructor-arg index="0" value="1"/>
<constructor-arg index="1" value="实验室器材分类"/>
</bean>
<bean id="flowerTarget" class="com.ssm.aop.xml.entity.Flower">
<constructor-arg index="0" value="白色"/>
<constructor-arg index="1" value="百合"/>
</bean>
<bean id="userTarget" class="com.ssm.aop.xml.entity.User">
<constructor-arg index="0" value="lab_admin"/>
<constructor-arg index="1" value="lab@ssm.com"/>
</bean>
<!-- 3. 配置代理类Spring原生AOP方式无需aspectj -->
<!-- 代理Category -->
<bean id="category" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="target" ref="categoryTarget"/>
<property name="interceptorNames">
<list>
<value>logAdvice</value>
</list>
</property>
</bean>
<!-- 代理Flower -->
<bean id="flower" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="target" ref="flowerTarget"/>
<property name="interceptorNames">
<list>
<value>logAdvice</value>
</list>
</property>
</bean>
<!-- 代理User -->
<bean id="user" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="target" ref="userTarget"/>
<property name="interceptorNames">
<list>
<value>logAdvice</value>
</list>
</property>
</bean>
</beans>