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
exceptions.
B
It has one parameter:
java.lang.String
It returns this value:
java.lang.Object
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:
java.util.Enumeration
The setAttribute() Method
public void setAttribute(java.lang.String name,
java.lang.Object)
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:
java.lang.String
java.lang.Object
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:
java.lang.String
 
Search WWH ::




Custom Search