beans有无状态
Spring Bean Scopes https://www.tutorialspoint.com/spring/spring_bean_scopes.htm When defining a <bean> you have the option of declaring a scope for that bean. For example, to force Spring to produce a new bean instance each time one is needed, you should declare the bean's scope attribute to be prototype . Similarly, if you want Spring to return the same bean instance each time one is needed, you should declare the bean's scope attribute to be singleton . The Spring Framework supports the following five scopes, three of which are available only if you use a web-aware ApplicationContext. Sr.No.