Difference between @Autowired and @Resource in Spring

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

Short URL for this post: http://wp.me/p4nxik-1z
This entry was posted in Spring Universe and tagged , , , . Bookmark the permalink.