About ServletContextListener
javax.servlet.ServletContextListener (Interface)
Get notified when the context is initialized (app is being deployed).
Get the context init parameters from the ServletContext.
Use the init parameter lookup name to make a database connection.
Store the database connection as an attribute, so that all parts of the web app can access it.
Get notified when the context is destroyed (the app is undeployedor goes down).
Close the database connection.
Get notified when the context is initialized (app is being deployed).
Get the context init parameters from the ServletContext.
Use the init parameter lookup name to make a database connection.
Store the database connection as an attribute, so that all parts of the web app can access it.
Get notified when the context is destroyed (the app is undeployedor goes down).
Close the database connection.