ServletContextAttributeListener (Servlet 6.1 API Documentation - Apache Tomcat 11.0.22)
Description: declaration: package: jakarta.servlet, interface: ServletContextAttributeListener

# Interface ServletContextAttributeListener

All Superinterfaces:
  `EventListener`

public interface ServletContextAttributeListener extends EventListener
Implementations of this interface receive notifications of changes to the attribute list on the servlet context of a web application. To receive notification events, the implementation class must be configured in the deployment descriptor for the web application.

Since:
  Servlet 2.3
See Also:
  - `ServletContextAttributeEvent`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `attributeAdded(ServletContextAttributeEvent scae)`
  Notification that a new attribute was added to the servlet context.
  `default void`
  `attributeRemoved(ServletContextAttributeEvent scae)`
  Notification that an existing attribute has been removed from the servlet context.
  `default void`
  `attributeReplaced(ServletContextAttributeEvent scae)`
  Notification that an attribute on the servlet context has been replaced.

- ## Method Details

  - ### attributeAdded

    default void attributeAdded(ServletContextAttributeEvent scae)
    Notification that a new attribute was added to the servlet context. Called after the attribute is added. The default implementation is a NO-OP.
    Parameters:
      `scae` - Information about the new attribute

  - ### attributeRemoved

    default void attributeRemoved(ServletContextAttributeEvent scae)
    Notification that an existing attribute has been removed from the servlet context. Called after the attribute is removed. The default implementation is a NO-OP.
    Parameters:
      `scae` - Information about the removed attribute

  - ### attributeReplaced

    default void attributeReplaced(ServletContextAttributeEvent scae)
    Notification that an attribute on the servlet context has been replaced. Called after the attribute is replaced. The default implementation is a NO-OP.
    Parameters:
      `scae` - Information about the replaced attribute