【发布时间】:2015-10-20 11:44:21
【问题描述】:
我真的对 spring 注释感到困惑。 在哪里使用@Autowired,其中class是@Bean还是@Component,
我知道我们不能使用
Example example=new Example("String");
在春天 但如何孤独
@Autowired
Example example;
会解决的目的吗? 那么 Example Constructor 呢,spring 是如何给 Example Constructor 提供 String 值的呢?
我浏览了其中一篇文章,但对我来说没有多大意义。 如果有人能给我简短的解释,那就太好了。
【问题讨论】: