亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

問題:IllegalArgumentException: error wildcard type pattern not allowed, must use type name****

執行test時,使用@Before("execution(* com.imooc.aop.aspectj.biz.*Biz.*(..))")可以成功測試,配置@Before("pointcut()"),出現IllegalArgumentException: error wildcard type pattern not allowed, must use type name at***錯誤,求解答

代碼如下:

//MoocAspect類
@Component
@Aspect
public?class?MoocAspect
{

	//?定義兩個切入點
	//?匹配方法執行的切入點
	@Pointcut("execution(*?com.imooc.aop.aspectj.biz.*Biz.*(..))")
	public?void?pointcut()
	{
	};

	//?限定匹配特定類型的連接點
	@Pointcut("with(com.imooc.aop.aspectj.biz.*)")
	public?void?biaPointcut()
	{
	};

	//?before?advice
	//?方法一
	//?@Before("execution(*?com.imooc.aop.aspectj.biz.*Biz.*(..))")
	@Before("pointcut()")
	public?void?before()
	{
		System.out.println("Before.");
	}
}


正在回答

2 回答

問題解決了:這里寫錯了??@Pointcut("with(com.imooc.aop.aspectj.biz.*)")?

改成@Pointcut("within(com.imooc.aop.aspectj.biz.*)")

就ok了。


0 回復 有任何疑惑可以回復我~

error wildcard type pattern not allowed, must use type name 這句話的意思是通配符類型不允許,要使用類型的名稱,是什么意思呢?


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

問題:IllegalArgumentException: error wildcard type pattern not allowed, must use type name****

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號