0

I already have an application implemented in Struts. I am trying to move it to Spring so I am doing everything step by step. First plan is to implement IOC (DI). now I got my DAOs fixed, i got my applicationContext.xml fixed now when I try to run the application (ofcourse) it does not create beans for me through applicationContext.xml(sometimes known as beans.xml) automatically. In my understanding i need to get my applicationContext.xml initialized before my service classes call method of my DAOs. what is proper flow of Spring's IOC or how will container start ApplicationContext.xml file.

  • what's in the applicationContext.xml? All your bean definitions? Are all of your spring configuration files in the classpath where your web.xml is loading them from? – Moe Matar Jul 21 '11 at 02:07

1 Answers1

0

Did you add the needed tags to the web.xml?

<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>WEB-INF/applicationContext.xml</param-value>
</context-param>

<listener>
 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
Andrew White
  • 52,720
  • 19
  • 113
  • 137