Java – default scope of spring Services

Which is the default scope of spring 4 @ service?

In order to store some information related to the currently recorded user (according to the current HTTP session), it is reasonable to design the service implementation through class properties (or use the final modifier)?

Solution

The default range is singleton

Yes In this case, the service will have to have a scope session see http://docs.spring.io/spring/docs/current/spring-framework-reference/html/beans.html#beans -factory-scopes-other

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>