Quantcast
Channel: Thorsten Maier – techscouting through the java news
Viewing all articles
Browse latest Browse all 44

Difference between @Autowired and @Resource in Spring

$
0
0

The main difference is that @Autowired wires per type and @Resource wires per bean name. But @Autowired in combination with @Qualifier also autowires by name.

…@Autowired is a spring annotation whereas @Resource is specified by the JSR-250. So the latter is part of normal java where as @Autowired is only available by spring.

Autowired and Resource difference – Spring Community Forums


Veröffentlicht in Spring Universe Tagged: annotation, Dependency Injection, Java Basics, spring

Viewing all articles
Browse latest Browse all 44

Trending Articles