Thursday, June 28, 2012

Spring: Bootstrapping From Webapp

This is how a Spring application is bootstrapped.

In web.xml, define the Spring context listener, so it will run when the app context is up, and also use the config file as defined in the <context-param> below:

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

<listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

No comments:

Post a Comment