ServletContextEvent (Servlet 6.1 API Documentation - Apache Tomcat 11.0.24)
Description: declaration: package: jakarta.servlet, class: ServletContextEvent

# Class ServletContextEvent

java.lang.Object
java.util.EventObject
jakarta.servlet.ServletContextEvent

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `ServletContextAttributeEvent`

public class ServletContextEvent extends EventObject
This is the event class for notifications about changes to the servlet context of a web application.

Since:
  Servlet 2.3
See Also:
  - `ServletContextListener`
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class EventObject

  `source`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ServletContextEvent(ServletContext source)`
  Construct a ServletContextEvent from the given context.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ServletContext`
  `getServletContext()`
  Return the ServletContext that changed.

  ### Methods inherited from class EventObject

  `getSource, toString`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ServletContextEvent

    public ServletContextEvent(ServletContext source)
    Construct a ServletContextEvent from the given context.
    Parameters:
      `source` - - the ServletContext that is sending the event.

- ## Method Details

  - ### getServletContext

    public ServletContext getServletContext()
    Return the ServletContext that changed.
    Returns:
      the ServletContext that sent the event.