What is bootstrap listener in the context of Spring framework?

Posted by jillionbug2fix on Programmers See other posts from Programmers or by jillionbug2fix
Published on 2013-08-22T06:32:01Z Indexed on 2013/10/21 16:09 UTC
Read the original article Hit count: 303

Filed under:
|

I am studying Spring framework, in web.xml I added following which is a bootstrap listener. Can anyone give me a proper idea of what is a bootstrap listener?

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

You can see the doc here: ContextLoadListener

Bootstrap listener to start up and shut down Spring's root WebApplicationContext. Simply delegates to ContextLoader as well as to ContextCleanupListener.

This listener should be registered after Log4jConfigListener in web.xml, if the latter is used.

As of Spring 3.1, ContextLoaderListener supports injecting the root web application context via the ContextLoaderListener(WebApplicationContext) constructor, allowing for programmatic configuration in Servlet 3.0+ environments. See WebApplicationInitializer for usage examples...

© Programmers or respective owner

Related posts about java

Related posts about spring