Top Description Methods
jakarta.servlet.annotation

public @Interface WebListener

extends Annotation
Annotations
@Target:TYPE
@Retention:RUNTIME
@Documented
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target

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: jakarta.servlet.http.HttpSessionAttributeListener, jakarta.servlet.http.HttpSessionListener, jakarta.servlet.ServletContextAttributeListener, jakarta.servlet.ServletContextListener, jakarta.servlet.ServletRequestAttributeListener, jakarta.servlet.ServletRequestListener or jakarta.servlet.http.HttpSessionIdListener
E.g. @WebListener
public TestListener implements ServletContextListener {
Since
Servlet 3.0

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

description of the listener, if present
value
()

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public String value()
Returns:String

description of the listener, if present