Java: Writing your own listener for a web app less than 1 minute read Example of implementing a ServletContextListener and configuring it in web.xml.