Spring AOP for non spring component

感情迁移 提交于 2019-11-28 11:57:10

问题


I am writing Spring 4 application with java config. I can use AOP in this project for all spring component. But i can't use it for a normal POJO class.

what is the library I need to add and what is the configuration I need to put in my config file to get this working


回答1:


If you want to apply AOP to non-Spring classes you need AspectJ, not a proxy-based "AOP lite" framework like Spring AOP. For more information about how to use AspectJ (which does not need Spring at all) in combination with Spring and how to configure load-time weaving, please read the corresponding part of the Spring manual.



来源:https://stackoverflow.com/questions/38043089/spring-aop-for-non-spring-component

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!