By default, @Autowire
enter a dependency of type. But it can also introduce dependencies "by name" using @Qualifier
in combination with the @Autowire
annotation.
But the main difference is that @Autowired
is a spring annotation, while @Resource
is set by JSR-250. So @Resource
is part of normal Java on the other side, @Autowired
is only available in Spring.
Rohan source share