spring mvc declaring all beans singleton

前端 未结 2 1647
失恋的感觉
失恋的感觉 2021-01-01 03:00

I have this new mvc project where all beans are default scoped(no prototype or session). with single application context.

i want to know by making all beans to b

2条回答
  •  抹茶落季
    2021-01-01 03:18

    Singleton means that the there will be only one instance of each bean. Generally, such beans are processing elements that carry no state. The methods called on them are passed the context which contains the inputs to work on. Hence the method calls on such singleton beans are inherently thread-safe.

提交回复
热议问题