Possible Duplicate:
@Resource vs @Autowired
I've defined a Spring @Controller
with @Scope("request")
and used @Resource
to get a service bean defined with @Scope("prototype")
, however at every page reload I always get the same instance of the service bean.
I found out that changing @Resource
to @Autowired
actually works in the way that I expect, and I get a new instance of the service bean for each page reload.
Is this an expected behaviour? Am I missing some understanding on the difference between @Resource
and @Autowired
?