public interface Context
extends javax.servlet.ServletContext
WebContainer for usage example.| Modifier and Type | Method and Description |
|---|---|
void |
addListener(Class<? extends EventListener> c)
Instantiates a listener from the given class and registers it with
this Context.
|
<T extends EventListener> |
addListener(T t)
Registers the given listener with this Context.
|
String |
getPath()
Return the context path for this Context.
|
SecurityConfig |
getSecurityConfig()
Gets the security related configuration for this context
|
boolean |
isDirectoryListing()
Checks whether directory listings are enabled or disabled on this
Context.
|
void |
setDefaultWebXml(String defaultWebXml)
Set the location of the default web xml that will be used.
|
void |
setDirectoryListing(boolean directoryListing)
Enables or disables directory listings on this Context.
|
void |
setPath(String path)
Set the context path for this Context.
|
void |
setSecurityConfig(SecurityConfig config)
Set the security related configuration for this context
|
getAttribute, getAttributeNames, getContext, getMajorVersion, getMimeType, getMinorVersion, getRealPath, getRequestDispatcher, getResource, getResourceAsStream, getServerInfo, getServlet, getServletNames, getServlets, log, log, log, removeAttribute, setAttribute<T extends EventListener> void addListener(T t)
The given listener must be an instance of one or more of the following interfaces:
t - the listener to be registered with this ContextIllegalArgumentException - if the given listener is not
an instance of any of the above interfacesIllegalStateException - if this context has already been
initialized and startedvoid addListener(Class<? extends EventListener> c)
The given listener must be an instance of one or more of the following interfaces:
c - the class from which to instantiate of the listenerIllegalArgumentException - if the given class does not
implement any of the above interfacesIllegalStateException - if this context has already been
initialized and startedvoid setDirectoryListing(boolean directoryListing)
directoryListing - true if directory listings are to be
enabled on this Context, false otherwiseboolean isDirectoryListing()
void setSecurityConfig(SecurityConfig config)
config - the security configuration for this contextSecurityConfigSecurityConfig getSecurityConfig()
SecurityConfigvoid setDefaultWebXml(String defaultWebXml)
defaultWebXml - the defaultWebXml path to be usedString getPath()
void setPath(String path)
Copyright © 2017. All rights reserved.