第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為什么我的輸出結(jié)果沒(méi)有MoocAspect before,只有AspectBiz呢?怎么覺(jué)得是配置文件沒(méi)有生效??

配置文件如下:

<?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-4.0.xsd">

? ? ? ?

? ? ? ?<bean id="moocAspect" class="com.imooc.aop.schema.advice.MoocAspect"></bean>

<bean id="aspectBiz" class="com.imooc.aop.schema.advice.AspectBiz"></bean>

<aop:config>

<aop:aspect id="moocAspectAOP" ref="moocAspect">

<aop:pointcut expression="execution(* com.imooc.aop.schema.advice.biz.*Biz.*(..))" id="moocPoint"/>?

? <aop:before method="before" pointcut-ref="moocPoint"/>

? </aop:aspect>

? </aop:config>?

?</beans>


輸出結(jié)果:

三月 06, 2016 8:42:08 下午 org.springframework.context.support.AbstractApplicationContext prepareRefresh

INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5bc22f22: startup date [Sun Mar 06 20:42:08 CST 2016]; root of context hierarchy

三月 06, 2016 8:42:08 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

INFO: Loading XML bean definitions from URL [file:/D:/Program%20Files%20(x86)/eclipse-jee-luna-SR2-win32-x86_64/eclipse/D/workspace/spring/bin/spring-aop-schema-aspect.xml]

AspectBiz

三月 06, 2016 8:42:08 下午 org.springframework.context.support.AbstractApplicationContext doClose

INFO: Closing org.springframework.context.support.ClassPathXmlApplicationContext@5bc22f22: startup date [Sun Mar 06 20:42:08 CST 2016]; root of context hierarchy


正在回答

3 回答

試一下在execution()里面的*后空一格,在寫(xiě)包那些方法

3 回復(fù) 有任何疑惑可以回復(fù)我~
#1

謝同學(xué)謝童鞋 提問(wèn)者

是的,就是這個(gè)錯(cuò)誤,已經(jīng)解決,非常感謝!
2016-04-12 回復(fù) 有任何疑惑可以回復(fù)我~
#2

二度

同謝~~~
2016-07-31 回復(fù) 有任何疑惑可以回復(fù)我~
#3

小小幻術(shù)師

分析半小時(shí)沒(méi)發(fā)現(xiàn)問(wèn)題,用你的方法解決了,再次感謝!
2017-05-08 回復(fù) 有任何疑惑可以回復(fù)我~

package com.imooc.aop.schema.advice;

public class AspectBiz {

public void biz(){

System.out.println("AspectBiz");

//throw new RuntimeException();

}

}


package com.imooc.aop.schema.advice;

import org.aspectj.lang.ProceedingJoinPoint;

public class MoocAspect {

public void before(){

System.out.println("MoocAspect before");

}

public void afterReturning(){

System.out.println("MoocAspect after");

}

public void afterThrowing(){

System.out.println("MoocAspect throwing");

}

public void after(){

System.out.println("MoocAspect after");

}

public Object around(ProceedingJoinPoint pjp){

Object obj = null;

try {

System.out.println("MoocAspect around 1");

obj = pjp.proceed();

System.out.println("MoocAspect around 2");

} catch (Throwable e) {

e.printStackTrace();

}

return obj;

}

}


package com.imooc.aop.schema.test;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.junit.runners.BlockJUnit4ClassRunner;

import com.imooc.aop.schema.advice.AspectBiz;

import com.imooc.test.UnitTestBase;

@RunWith(BlockJUnit4ClassRunner.class)

public class TestAOPSchemaAdvice extends UnitTestBase{

public TestAOPSchemaAdvice(){

super("classpath*:spring-aop-schema-aspect.xml");

}

@Test

public void testBiz(){

AspectBiz biz = super.getBean("aspectBiz");

biz.biz();

}

}

http://img1.sycdn.imooc.com//56e0dfb0000140f002460146.jpg

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

兮蓅

您好,請(qǐng)問(wèn)為什么您MoocAspect類(lèi)中需要導(dǎo)入org.aspectj.lang.ProceedingJoinPoint包?
2016-12-08 回復(fù) 有任何疑惑可以回復(fù)我~
#2

兮蓅 回復(fù) 兮蓅

我知道了
2016-12-08 回復(fù) 有任何疑惑可以回復(fù)我~

要不要把java文件也貼上來(lái),這樣更容易確定問(wèn)題

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為什么我的輸出結(jié)果沒(méi)有MoocAspect before,只有AspectBiz呢?怎么覺(jué)得是配置文件沒(méi)有生效??

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)