Class Overview
A wrapper around servlet context that allows plugin servlets to add
attributes which will not be shared/clobbered by other plugins.
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
javax.servlet.ServletContext
|
Public Constructors
Public Methods
public
Object
getAttribute
(String name)
Gets the named attribute. The attribute is first looked for in the local
attribute map, if it is not found there it is looked for in the wrapped
contexts attribute map. If it is not there, null is returned.
A consequence of this ordering is that servlets may, in their own
context, override but not overwrite attributes from the wrapped context.
public
Enumeration
getAttributeNames
()
Returns
- an enumeration of all the attributes from the wrapped
context as well as the local attributes.
public
ServletContext
getContext
(String uripath)
Returns
- null so that servlet plugins can't escape their box
public
String
getContextPath
()
public
String
getInitParameter
(String name)
Returns
- the init parameter from the servlet module descriptor.
public
Enumeration
getInitParameterNames
()
Returns
- an enumeration of the init parameters from the servlet module
descriptor.
public
int
getMajorVersion
()
public
int
getMinorVersion
()
public
RequestDispatcher
getNamedDispatcher
(String name)
public
RequestDispatcher
getRequestDispatcher
(String path)
public
URL
getResource
(String path)
Returns
- the resource from the plugin classloader if it exists, otherwise the
resource is looked up from the wrapped context and returned
public
InputStream
getResourceAsStream
(String path)
Returns
- the resource stream from the plugin classloader if it exists, otherwise
the resource stream is attempted to be retrieved from the wrapped context
public
String
getServerInfo
()
public
Servlet
getServlet
(String name)
public
String
getServletContextName
()
public
void
removeAttribute
(String name)
Removes an attribute from the local context. Leaves the wrapped context
completely untouched.
public
void
setAttribute
(String name, Object object)
Sets an attribute in the local attribute map, leaving the wrapped
context untouched.
Servlets may use this and the lookup ordering of the
getAttribute()
method to effectively override the value
of an attribute in the wrapped servlet context with their own value and
this overridden value will only be seen in the plugins own scope.