adspace


What is difference between @autowired and @resource in spring?

Answer Posted / Nitin Aliwal

@Autowired is annotated on a field or setter method to indicate that Spring should manage the dependency injection of that specific bean. @Resource can also be used, but it's more flexible as it allows for customization via JNDI lookup names.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you inject java collection in spring?

518


What is lazy class?

490


What is difference between @controller and @restcontroller in spring?

556