WebListener (Servlet 4.0 API Documentation - Apache Tomcat 9.0.111)
Description: declaration: package: javax.servlet.annotation, annotation type: WebListener

# Annotation Type WebListener

@Target(TYPE) @Retention(RUNTIME) @Documented public @interface WebListener
The annotation used to declare a listener for various types of event, in a given web application context.
The class annotated MUST implement one, (or more), of the following interfaces: `HttpSessionAttributeListener`, `HttpSessionListener`, `ServletContextAttributeListener`, `ServletContextListener`, `ServletRequestAttributeListener`, `ServletRequestListener` or `HttpSessionIdListener`
E.g. `@WebListener`
`public TestListener implements ServletContextListener {`

Since:
  Servlet 3.0

- ## Optional Element Summary

  Optional Elements
  Modifier and Type
  Optional Element
  Description
  `String`
  `value`

- ## Element Details

  - ### value

    String value
    Returns:
      description of the listener, if present
    Default:
      `""`