Use @Autowired
or @Inject
. This limitation is covered in the Spring reference documentation: Fine-tuning annotation-based autowiring with qualifiers:
@Autowired applies to fields, constructors, and multi-argument methods, allowing for narrowing through qualifier annotations at the parameter level. By contrast, @Resource is supported only for fields and bean property setter methods with a single argument. As a consequence, stick with qualifiers if your injection target is a constructor or a multi-argument method.
출처 : http://stackoverflow.com/questions/5831128/is-it-possible-to-use-resource-on-a-constructor
'개발 > 스프링' 카테고리의 다른 글
JavaConfig 예제 (dataSource) (0) | 2016.10.27 |
---|---|
@Autowired @Inject @Resource (0) | 2016.10.27 |
Spring doesn't evaluate @Value annotation from properties (0) | 2016.10.14 |
[SPRING BOOT] MYBATIS 활용 (0) | 2016.08.03 |
[SPRING BOOT] SPRING BATCH + SCHEDULER (0) | 2016.08.03 |
댓글