Spring Beans Configurations
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Spring Beans Configurations相关的知识,希望对你有一定的参考价值。
Bean Properties
a) Bean property can be set by <Property> syntax.
b) Bean property can be set by p:xxx syntex.
c) Arbitrary properties can be set by <list> or <props> or <map> according to the property type.
Bean Destory
a) Destory method will be called when the ApplicationContext is closed.
b) Destory method will only be called when the bean scope is "singleton".
Bean Factory
a) The default bean factory is the matched constructor method of the class.
b) The factory method can be assigned to a static method of the class.
c) The factory method can be assigned to a method of another class (factory class). The factory class also has to be added as a bean.
Bean Nest
a) Bean can be defined within a bean, which will be inner bean. The inner bean can‘t be refered outside its parent bean.
以上是关于Spring Beans Configurations的主要内容,如果未能解决你的问题,请参考以下文章