Spring and Abstract class - injecting properties in abstract classes

前端 未结 3 1610
忘掉有多难
忘掉有多难 2020-12-10 11:57

I have an abstract base class with a property called \"mailserver\" which I wish to inject from the spring ioc container. However when I run the concreted implementations of

3条回答
  •  北海茫月
    2020-12-10 12:41

    Mark the abstract base class definition as abstract by using the abstract attribute , and in the concrete class definition , make the parent attribute be the name of the abstract class 's bean name

    Something like this:

    
      
    
    
         
      
      
    
    

提交回复
热议问题