xmlns:aop="http://www.springframework.org/schema/aop"
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
<bean id="sampleAspect" class="com.tuyano.libro.aop.SampleAspect" />これは、既に何度もやりましたね。Beanの登録用のタグです。SampleAspectクラスとSampleAopBeanクラスをそれぞれBeanとして登録します。
<bean id="sampleAopBean" class="com.tuyano.libro.aop.SampleAopBean">
<property name="message" value="this is AOP bean!" />
</bean>
<aop:aspectj-autoproxy />これは、AspectJのためのタグです。これは、先にSpring AOPのときに利用したProxyFactoryBeanに相当するものを自動生成するためのタグです。これを記述することで、ProxyFactoryBeanで用意された機能が自動的に組み込まれます。
※リストが表示されない場合
AddBlockなどの広告ブロックツールがONになっているとリストなどが表示されない場合があります。これらのツールをOFFにしてみてください。
<?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" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <bean id="sampleAspect" class="com.tuyano.libro.aop.SampleAspect" /> <bean id="sampleAopBean" class="com.tuyano.libro.aop.SampleAopBean"> <property name="message" value="this is AOP bean!" /> </bean> <aop:aspectj-autoproxy /> </beans>
<< 前へ | 次へ >> |