dimanche 20 octobre 2013

Spring Bean Scopes Example

In Spring, bean scope is used to decide which type of bean instance should be return from Spring container back to the caller :
5 types of bean scopes supported :

  1. singleton – Return a single bean instance per Spring IoC container
  2. prototype – Return a new bean instance each time when requested
  3. request – Return a single bean instance per HTTP request. *
  4. session – Return a single bean instance per HTTP session. *
  5. globalSession – Return a single bean instance per global HTTP session. *
In most cases, you may only deal with the Spring’s core scope – singleton and prototype, and the default scope is singleton.
P.S * means only valid in the context of a web-aware Spring ApplicationContext
for more informations, these notes were taken from : http://www.mkyong.com/spring/spring-bean-scopes-examples/

1 commentaire:

  1. Hotel Casino - Mapyro
    Casino Hotel. Casino & Brewery. 2445 S W. Atlantic City, New Jersey 08401. Directions 태백 출장안마 · 군포 출장샵 (609) 317-5000. Call Now · More Info. 보령 출장마사지 Hours, Accepts 문경 출장안마 Credit Cards, 포천 출장안마 Parking

    RépondreSupprimer