Naveen Vanjani
Naveen Vanjani

Reputation: 35

How the spring container starts and ways to load the spring container

I want to know how actually the spring container gets loaded on server.. and in how many ways can that be done and exactly how the server comes to know that it has to start the spring container. I tried to google it but no luck.

Upvotes: 1

Views: 846

Answers (1)

Michael
Michael

Reputation: 291

The simplest solutions is to use a ContextLoaderListener:

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

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

See http://static.springsource.org/spring/docs/4.0.x/spring-framework-reference/html/web-integration.html for details.

Upvotes: 1

Related Questions