how will container start ApplicationContext.xml file
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开发者_Go百科 or how will container start ApplicationContext.xml file.
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>
精彩评论