3 kinds of way to class to spring container

1)@Bean

 

 

 

 2)@Component

 

 

 

 3) @Import way

(1) a first, direct assembly, can be used to add multiple comma

 

 (2) a second, can be centrally managed, but also String data array may be in a configuration file.

 

 

 (3) Third, some of the parameters can be brought

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/lql6/p/11805876.html