AOPはメソッドと同様のカットソリューションを呼び出すことはできません

質問:AOPはクラスのすべてのメソッドをカットすると、このクラスの各メソッドを呼び出すだけ最外層の方法を強化する、方法が強化されたと呼ばれることはありません

次のように解決策は以下のとおりです。

春ブーツのバージョンまたは古いバージョンを1.spring

溶液はapplicationContext.xmlを中にピースを追加することである< :AspectJのautoproxy- AOP  プロキシターゲットクラス=「真の」EXPOSE -proxy = 「真の」/> 

<?XMLバージョン= "1.0"エンコード= "UTF-8" ?> 
< のxmlns = "http://www.springframework.org/schema/beans" 
       のxmlns:XSI = "http://www.w3.org/2001 / XMLスキーマ・インスタンス" 
       のxmlns:AOP = "http://www.springframework.org/schema/aop" 
       のxsi:schemaLocationの=" http://www.springframework.org/schema/beans 
           のhttp://www.springframework。 ORG /スキーマ/豆/春豆-3.0.xsd 
           http://www.springframework.org/schema/aop 
           http://www.springframework.org/schema/aop/spring-aop-3.0.xsd」> 
 
    < AOP:AspectJの-自動プロキシプロキシ対象クラス=」/> 
 
</ >

ブートバージョンを2.spring

追加ApplicationMain起動クラス@EnableAspectJAutoProxy(proxyTargetClass =真、exposeProxy =真)

おすすめ

転載: www.cnblogs.com/lzj123/p/11542539.html
おすすめ