Notice: Constant WP_MEMORY_LIMIT already defined in /home/javawith/public_html/codesjava.com/wp-config.php on line 107

Notice: Constant WP_MAX_MEMORY_LIMIT already defined in /home/javawith/public_html/codesjava.com/wp-config.php on line 108
Spring bean scopes - CodesJava

CodesJava

Easy learning with example program codes

spring bean scopes examples


Notice: Undefined variable: footnotelist in /home/javawith/public_html/codesjava.com/wp-content/plugins/latex2html/inc/core.php on line 475

Spring bean scopes:

As we discussed that spring container is responsible for creating and managing bean object. Spring provides the facility to return the same instance or a new instance each time when one is needed. It depends upon the bean scope.

Spring framework bean scopes:

Bean Scope Description
1. singleton It scopes the bean definition to a single instance per spring container. It is the default scope. Spring container keeps it into cache and returns the same instance each time a request for that particular bean is made.
2. prototype It scopes a single bean definition to have new bean instance each time a request for that particular bean is made.
3. request It scopes a bean definition to an HTTP request.
4. session It scopes a bean definition to an HTTP session.
5. global-session It scopes a bean definition to a global HTTP session.

 
Note: The request, session and global-session are only available in the context of a web-aware ApplicationContext.

 

Please follow and like us:
error

Spring Tutorial








Copyright © 2019 CodesJava DMCA.com Protection Status