Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Servlet context listener

Shulou Source: shulou.com Published: 2022-06-03 07:27:03 09月23日 Update

ServletContextListener

WebListenerpublic class ServletContextListenerDemo implements ServletContextListener {@ Override public void contextInitialized (ServletContextEvent servletContextEvent) {} @ Override public void contextDestroyed (ServletContextEvent servletContextEvent) {}}

ServletContextAttributeListener

WebListenerpublic class ServletContextAttributeListenerDemo implements ServletContextAttributeListener {@ Override public void attributeAdded (ServletContextAttributeEvent servletContextAttributeEvent) {} @ Override public void attributeRemoved (ServletContextAttributeEvent servletContextAttributeEvent) {} @ Override public void attributeReplaced (ServletContextAttributeEvent servletContextAttributeEvent) {}}

Description: servletContext context listener is the context that the whole application loads when it starts. A web application will have only one context. Therefore, servletContext is effective for the whole process of appliction.

Tags: Valid up and down context whole process time listener application monitor Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Shulou Tech Info Linux Microsoft Apple