spring中scope作用域设置sigleton还是prototype

1.对于有实例变量的类,要设置成prototype;没有实例变量的类,就用默认的singleton
2.Action一般我们都会设置成prototype,而Service只用singleton就可以。
参照地址

猜你喜欢

转载自blog.csdn.net/ppwwp/article/details/86294839
今日推荐