Saturday, 15 August 2015

Java Source World: What bean scopes does Spring support


The Spring Framework supports following five scopes, three of which are available only if you use a webaware ApplicationContext.

singleton: This scopes the bean definition to a sing le instance per Spring IoC container.

prototype: This scopes a single bean definition to have any number of object instances.

request: This scopes a bean definition to an HT T P request. Only valid in the context of a web-aware Spring ApplicationContext.

session: This scopes a bean definition to an HT T P session. Only valid in the context of a web-aware Spring ApplicationContext.

global-session: This scopes a bean definition to a global HT T P session. Only valid in the context of a web-aware Spring ApplicationContext.

No comments:

Post a Comment