相关疑难解决方法(0)

使用@Component 和@Autowired 时的Spring bean 原始属性?

如何为bean的原始属性设置值?

既然我们有@Component注解,@Autowired注解也用于绑定实例依赖,那么原始属性呢?

@Component
class Person{
@Autowired
Address address;

int age /// what about this one?
}
Run Code Online (Sandbox Code Playgroud)

java spring

5
推荐指数
1
解决办法
7165
查看次数

标签 统计

java ×1

spring ×1