why @autowired is not working when I access a bean

前端 未结 4 442
悲&欢浪女
悲&欢浪女 2021-01-27 21:45

When I access a bean from spring bean configuration file using BeanFactory like this:

public class Person {
    private String id,address;
    @Autowired
    pri         


        
4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-27 22:33

    Approach 1: Include below code in your xml

    
    
        
    
        
    
    

    Approach 2: Remove @Autowired and inject customer in your xml file only.

    
        
    
    
        
        
    
    

提交回复
热议问题