This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Spring and the fly likes What is the purpose of the ContextLoaderListener Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Spring
Reply Bookmark "What is the purpose of the ContextLoaderListener" Watch "What is the purpose of the ContextLoaderListener" New topic
Author

What is the purpose of the ContextLoaderListener

Daniel Sagayaraj
Ranch Hand

Joined: Mar 15, 2010
Posts: 32
Dear Friends,
I am learning spring.I would like to know when and why we use the ContextLoaderListener.


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4">

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

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/contacts.xml, /WEB-INF/resources.xml</param-value>
</context-param>

</web-app>
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

So Spring is initialized on startup.

http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/context/ContextLoaderListener.html
Daniel Sagayaraj
Ranch Hand

Joined: Mar 15, 2010
Posts: 32


Hai David,
I went through the link you had given me.I am sorry that i was not able to visualize the purpose of the ContextLoaderListener.What does ContextLoaderListener do in a web application?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Initializes Spring on application startup.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the purpose of the ContextLoaderListener
 
Similar Threads
Spring with Hibernate Integration
Jsf Error for simple jsf program in web application.
Problems loading Spring ContextLoaderListener without a servlet.
Application context in spring
Load the beanrefContext.xml in web Application