Tutorial by Examples

If a bean is defined with singleton scope, there will only be one single object instance initialized in the Spring container. All requests to this bean will return the same shared instance. This is the default scope when defining a bean. Given the following MyBean class: public class MyBean { ...
A prototype-scoped bean is not pre-created on Spring container startup. Instead, a new fresh instance will be created every time a request to retrieve this bean is sent to the container. This scope is recommended for stateful objects, since its state won't be shared by other components. In order to...
There are several scopes that are available only in a web-aware application context: request - new bean instance is created per HTTP request session - new bean instance is created per HTTP session application - new bean instance is created per ServletContext globalSession - new bean instance i...

Page 1 of 1