点击这里成为作者 · 更新于 2017-10-23 15:00:28

都有哪些 bean 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

  • global-session: Return a single bean instance per global HTTP session

默认的是 singleton

上一篇: 什么是 bean? 下一篇: Singleton bean...