弹簧范围注释值
Spring 框架是否提供 String 常量来替换下面的示例注释中的“原型”字符串文本值?
@Service
@Scope("prototype")
public class CustomerService
{
......
}
谢谢!
Spring 框架是否提供 String 常量来替换下面的示例注释中的“原型”字符串文本值?
@Service
@Scope("prototype")
public class CustomerService
{
......
}
谢谢!
您可以使用 Spring's BeanDefinition 中的 scope 常量:
例如:
@Scope(BeanDefinition.SCOPE_PROTOTYPE)