Annotation to do Dependency injection in spring

Is there any other annotation apart from @Autowired to perform dependency injection in spring ?
Rohit BajajAsked:
Who is Participating?
mccarlConnect With a Mentor IT Business Systems Analyst / Software DeveloperCommented:
There is also @Resource although it does operate slightly differently to the others. Check out the docs and also this blog post gives some useful info...
gurpsbassiConnect With a Mentor Commented:
Use @Inject
Jim CakalicConnect With a Mentor Senior Developer/ArchitectCommented:
In addition to the big 3 mentioned in your question and previous comments, there are other annotations that compose the container configuration 'ecosystem'. The Spring Reference has useful information on Spring vs JSR-330 annotations in chapter 7, particularly sections 7.9 - 7.11.
Spring Framework Reference

In my experience, mixing and matching can be troublesome (similar to mixing Hibernate and JSR-338 annotations). I've found the most successful path is to pick one set that works for your project and stick with it. The decision will probably revolve around whether your application is meant to be JEE-compliant.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.