Spring Bean Scope Tutorial - Singleton, Prototype, Request, Session and Global Session

Описание к видео Spring Bean Scope Tutorial - Singleton, Prototype, Request, Session and Global Session

#Spring #Bean #Scope

GitHub Account for Free Code download: https://github.com/admindebu
Follow me on FaceBook:   / techtalkdebu  
Instagram: techtalk_debu
LinkedIn :   / debu-paul  

if you like my video, please subscribe to my channel and share the video

#Define by :::: @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
#singleton: This bean scope is default and it enforces the container to have only one instance per Spring container irrespective of how much time you request for its instance. This singleton behavior is maintained by the bean factory itself.
#prototype: This bean scope just reverses the behavior of singleton scope and produces a new instance each and every time a bean is requested.
#request: With this bean scope, a new bean instance will be created for each web request made by the client. As soon as request completes, the bean will be out of scope and garbage collected.
#session: Just like request scope, this ensures one instance of bean per user session. As soon as the user ends its session, the bean is out of scope.
#global-session: global-session is something that is connected to Portlet applications. When your application works in Portlet container it is built of some amount of portlets. Each portlet has its own session, but if you want to store variables global for all portlets in your application then you should store them in global-session. This scope doesn’t have any special effect different from session scope in Servlet based applications.


Thanks & Regards,
Debu Paul

Комментарии

Информация по комментариям в разработке