Spring Bean Scopes

前端 未结 9 1761
说谎
说谎 2020-11-29 18:25

Can someone explain what the scopes are in Spring beans I\'ve always just used \'prototype\' but are there other parameters I can put in place of that?

Example of wh

9条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 18:57

    Also websocket scope is added:

    Scopes a single bean definition to the lifecycle of a WebSocket. Only valid in the context of a web-aware Spring ApplicationContext.

    As the per the content of the documentation, there is also thread scope, that is not registered by default.

提交回复
热议问题