I use AnnotationConfigApplicationContext to configure my application. How I can specify bean scope using annotations or in other xml-free way?
I use AnnotationConfigApplicationContext to configure my application. How I can specify bean scope using
Share
Different Types of scope:
singleton – Return a single bean instance per Spring IoC container
prototype – Return a new bean instance each time when requested
request – Return a single bean instance per HTTP request. *
session – Return a single bean instance per HTTP session. *
globalSession – Return a single bean instance per global HTTP session. *
XML-Free Way: