Thursday, July 22, 2010

How to autowire things in spring

In order to autowire something the following things must be true (that i know of)
  • - The object you are autowiring needs to be annotated with @Component
  • - The object that will contain the autowired object needs to come from the spring context, meaning:
    • - applicationContext.xml needs to have a bean definition of it
    • - the place where its is newed  needs to be replaced with the call to pull it from the WebApplicationContext

No comments:

Post a Comment