Top Description Fields Constructors Methods
jakarta.servlet

public Class ServletContextAttributeEvent

extends ServletContextEvent
Class Inheritance

This is the event class for notifications about changes to the attributes of the servlet context of a web application.
Since
Servlet 2.3
See Also
ServletContextAttributeListener

Field Summary

Modifier and TypeField and Description
private final String
name

Attribute name.

private static final long
private final Object
value

Attribute value.

Constructor Summary

AccessConstructor and Description
public
ServletContextAttributeEvent(ServletContext
The ServletContext associated with this attribute event
source
,
String
The name of the servlet context attribute
name
,
Object
The value of the servlet context attribute
value
)

Construct a ServletContextAttributeEvent from the given context for the given attribute name and attribute value.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The name of the attribute that changed
getName
()

Return the name of the attribute that changed on the ServletContext.

public Object

Returns:

If the attribute was added, this is the value of the attribute. If the attribute was removed, this is the value of the removed attribute. If the attribute was replaced, this is the old value of the attribute.
getValue
()

Returns the value of the attribute that has been added, removed, or replaced.

Inherited from jakarta.servlet.ServletContextEvent:
getServletContext

Field Detail

nameback to summary
private final String name

Attribute name.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides jakarta.servlet.ServletContextEvent.serialVersionUID.

valueback to summary
private final Object value

Attribute value.

Constructor Detail

ServletContextAttributeEventback to summary
public ServletContextAttributeEvent(ServletContext source, String name, Object value)

Construct a ServletContextAttributeEvent from the given context for the given attribute name and attribute value.

Parameters
source:ServletContext

The ServletContext associated with this attribute event

name:String

The name of the servlet context attribute

value:Object

The value of the servlet context attribute

Method Detail

getNameback to summary
public String getName()

Return the name of the attribute that changed on the ServletContext.

Returns:String

The name of the attribute that changed

getValueback to summary
public Object getValue()

Returns the value of the attribute that has been added, removed, or replaced.

Returns:Object

If the attribute was added, this is the value of the attribute. If the attribute was removed, this is the value of the removed attribute. If the attribute was replaced, this is the old value of the attribute.