Announcement Announcement Module
Collapse
No announcement yet.
Does Spring support a mix of XML and Annotation based dependency injections? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Does Spring support a mix of XML and Annotation based dependency injections?

    I'm fairly new to Spring and trying to come up to speed as quickly as possible, so please forgive me if the answer to my question seems like a no-brainer...

    Is it possible to have an application with mixed XML/annotation-based dependecy injection?

    For example, say I want to inject a class from a 3rd party jar and initialize it with some properties from the beans.xml config file ( <bean id="foo" ....>). Can I then use the @autowire annotation to inject an instance of bean foo into my new Spring-based class?
    Last edited by jersey355; Apr 2nd, 2013, 10:11 PM.

  • #2
    Never mind, found the answer elsewhere and was able to test it out. Short answer, yes it's possible.

    Comment

    Working...
    X