Spring注解之@Scope("prototype")
2017-02-24 15:28
405 查看
@Scope("prototype")
该注解可以使每次使用bean时都实例化一个新的对象
这样,当从 Spring 容器中获取 boss Bean 时,每次返回的都是新的实例了。
相关连接:http://blog.csdn.net/xyh820/article/details/7303330/
该注解可以使每次使用bean时都实例化一个新的对象
package com.baobaotao; import org.springframework.context.annotation.Scope; … @Scope("prototype") @Component("boss") public class Boss { … } |
相关连接:http://blog.csdn.net/xyh820/article/details/7303330/
相关文章推荐
- Spring注解@Scope("prototype")
- spring注解中@Scope("prototype")的重要性
- Spring 注解 @Scope("prototype") 的作用
- Spring注解@Scope("prototype")
- Spring注解@Scope("prototype")
- Spring注解@Scope("prototype")
- Spring注解@Scope("prototype")
- Spring注解@Scope("prototype")
- Spring注解@Scope("prototype") Spring在Action上面注解@Scope("prototype")
- struts+spring action应配置为scope="prototype"
- Spring的scope="prototype"属性
- spring bean scope="prototype" 有状态bean 无状态bean
- struts+spring action应配置为scope="prototype"
- spring scope="prototype" 和scope="singleton"区分
- spring scope="prototype"
- Spring中scope="prototype"属性的作用
- spring scope="prototype" 和scope="singleton"区分
- spring scope="prototype"&nb…
- spring scope="prototype" 和scope="singleton"区分
- spring scope="prototype" 和scope="singleton"区分