File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes What is the purpose of the ContextLoaderListener Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
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