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



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

Answer / 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

More Spring Framework Interview Questions

Name the exceptions thrown by the spring dao classes?

1 Answers  


What do you mean by spring beans? What does bean scopes spring support? Explain each.

1 Answers  


What is webapplicationcontext?

1 Answers  


What is bean factory?

1 Answers  


What are the ways by which hibernate can be accessed using spring?

1 Answers  


How can you fetch records by spring jdbctemplate?

1 Answers  


What is requestmapping?

1 Answers  


What is @repository in spring boot? : Spring Boot

1 Answers  


What is logback?

1 Answers  


What is a jointpoint?

1 Answers  


When should you use a singleton?

1 Answers  


Explain the different modes of auto wiring.

1 Answers  


Categories