spring 学习1
1. Spring is lightweight=?minimal impact
2. Spring DI= JavaBeans +interfaces3.JSR-330=Dependency Injection for Java4.JSR-303=?Bean Validation API specification?5.?@Service("injectCollection") public class CollectionInjection { @Resource(name="map") private Map<String, Object> map; @Resource(name="props") private Properties props; @Resource(name="set") private Set set; @Resource(name="list") private List list; // Other codes omitted }?11.Bean Scopes?Singleton:The default singleton scope.?Prototype:A new instance will be created by Spring when requested by application.?Request:For web application use. When using Spring MVC for web application,?beans with request scope will be instantiated for every HTTP request and then?destroyed when the request is completed.?Session:For web application use. When using Spring MVC for web applications,?beans with session scope will be instantiated for every HTTP session and then?destroyed when the session is over.?Global session:For portlet-based web applications. The global session scope beans?can be shared among all portlets withinthe same Spring MVC–powered portal?application.?Thread: A new bean instance will be created by Spring when requested by a new?thread, while for the same thread, the same bean instance will be returned. Note?that this scope is not registered by default.?Custom:Custom bean scope that can be created by implementing the interface?org.springframework.beans.factory.config.Scopeand registering the custom?scope in Spring’s configuration (for XML, use the class org.springframework.beans?.factory.config.CustomScopeConfigurer).?