Spring Request and Prototype Scope?

后端 未结 3 1355
忘了有多久
忘了有多久 2020-12-13 00:53

Below are the definitions of prototype and request scope in Spring.

prototype Scopes a single bean definition to any number of object instances.

request Sc

3条回答
  •  情书的邮戳
    2020-12-13 01:38

    You are off. Prototype is described in the docs here as

    "The non-singleton, prototype scope of bean deployment results in the creation of a new bean instance every time a request for that specific bean is made."

    Your description of request scoped beans is accurate.

    Probably just got the wires crossed vis-a-vis prototype vs singleton.

提交回复
热议问题