Java Reference
In-Depth Information
The getAttribute() method returns an object stored in the ServletContext and keyed by the
name value passed in. This is one of the methods used to share resources between servlets. The
returning object must be downcast to its original type before use. getAttribute() throws no
It has one parameter:
It returns this value:
The getAttributeNames() Method
public java.util.Enumeration getAttributeNames()
The getAttributeNames() method returns an enumeration of strings representing the names
of the attributes currently stored in the ServletContext . getAttributeNames() has no para-
meters and throws no exceptions.
It returns this value:
The setAttribute() Method
public void setAttribute(java.lang.String name,
The setAttribute() method stores an object in the ServletContext and binds the object to
the given name. If the name already exists in the ServletContext , it is replaced.
setAttribute() returns no value and throws no exceptions.
It has two parameters:
The removeAttribute() Method
public void removeAttribute(java.lang.String name)
The removeAttribute() method removes the object, which is bound to the passed-in name,
from the ServletContext . removeAttribute() returns no value and throws no exceptions.
It has one parameter:
Search WWH ::

Custom Search