How to autowire bean in same bean

后端 未结 3 941
无人共我
无人共我 2021-01-23 04:52

I would like to autowire instance of bean A to the same instance of A. How can I achieve this with annotation (without XML).

Example:



        
3条回答
  •  情话喂你
    2021-01-23 05:07

    You can use compile-time weaving (with Aspectj compiler) so aspects do not need proxy to work. Just add this into your pom.xml configuration:

    
        org.aspectj
        aspectjrt
    
    
    
        org.codehaus.mojo
        aspectj-maven-plugin
        
            
                
                    org.springframework
                    spring-aspects
                
            
        
    
    

提交回复
热议问题