public class ServletHttpContext extends HttpContext
__ErrorHandler, __fileClassPathAttr| Constructor and Description |
|---|
ServletHttpContext()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLocaleEncoding(String locale,
String encoding) |
ServletHolder |
addServlet(String pathSpec,
String className)
Add a servlet to the context.
|
ServletHolder |
addServlet(String name,
String pathSpec,
String className)
Add a servlet to the context.
|
boolean |
checkSecurityConstraints(String pathInContext,
HttpRequest request,
HttpResponse response) |
void |
destroy()
Destroy a context.
|
protected void |
doStop()
Stop the context.
|
Object |
enterContextScope(HttpRequest request,
HttpResponse response)
Enter the context scope.
|
String |
getLocaleEncoding(Locale locale)
Get the character encoding for a locale.
|
javax.servlet.ServletContext |
getServletContext() |
ServletHandler |
getServletHandler()
Get the context ServletHandler.
|
protected boolean |
jSecurityCheck(String pathInContext,
HttpRequest request,
HttpResponse response) |
void |
sendError(HttpResponse response,
int code,
String msg)
Send an error response.
|
String |
toString() |
addClassPath, addClassPaths, addHandler, addHandler, addPermission, addSecurityConstraint, addVirtualHost, addWelcomeFile, canonicalContextPathSpec, clearSecurityConstraints, doStart, flushCache, getAttribute, getAttributeNames, getAttributes, getAuthenticator, getBaseResource, getClassLoader, getClassPath, getContextPath, getEncodingByMimeType, getEncodingMap, getFileClassPath, getHandler, getHandlerIndex, getHandlers, getHosts, getHttpConnection, getHttpContext, getHttpContextName, getHttpServer, getInitParameter, getInitParameterNames, getMaxCachedFileSize, getMaxCacheSize, getMimeByExtension, getMimeMap, getName, getParentClassLoader, getPermissions, getRealm, getRealmName, getRequestLog, getRequests, getRequestsActive, getRequestsActiveMax, getResource, getResourceBase, getResourceMetaData, getResponses1xx, getResponses2xx, getResponses3xx, getResponses4xx, getResponses5xx, getServerClasses, getStatsOn, getStatsOnMs, getStopGracefully, getSystemClasses, getTempDirectory, getVirtualHosts, getWelcomeFile, getWelcomeFiles, handle, handle, initClassLoader, initialize, isClassLoaderJava2Compliant, isRedirectNullPath, leaveContextScope, loadClass, log, removeAttribute, removeHandler, removeHandler, removeVirtualHost, removeWelcomeFile, sendContextError, setAttribute, setAttributes, setAuthenticator, setBaseResource, setClassLoader, setClassLoaderJava2Compliant, setClassPath, setContextPath, setEncodingMap, setHandlers, setHosts, setHttpContextName, setInitParameter, setMaxCachedFileSize, setMaxCacheSize, setMimeMap, setMimeMapping, setParentClassLoader, setPermissions, setRealm, setRealmName, setRedirectNullPath, setRequestLog, setResourceBase, setServerClasses, setStatsOn, setStopGracefully, setSystemClasses, setTempDirectory, setTypeEncoding, setVirtualHosts, setWelcomeFiles, startHandlers, statsReset, stop, toStringaddComponent, addEventListener, getComponents, isStarted, isStarting, isStopping, removeComponent, removeEventListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddEventListener, removeEventListenerpublic javax.servlet.ServletContext getServletContext()
public ServletHandler getServletHandler()
public ServletHolder addServlet(String pathSpec, String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException
pathSpec - The pathspec within the contextclassName - The classname of the servlet.ClassNotFoundExceptionInstantiationExceptionIllegalAccessExceptionpublic ServletHolder addServlet(String name, String pathSpec, String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException
name - The name of the servlet.pathSpec - The pathspec within the contextclassName - The classname of the servlet.ClassNotFoundExceptionInstantiationExceptionIllegalAccessExceptionprotected boolean jSecurityCheck(String pathInContext, HttpRequest request, HttpResponse response) throws IOException
IOExceptionpublic boolean checkSecurityConstraints(String pathInContext, HttpRequest request, HttpResponse response) throws HttpException, IOException
checkSecurityConstraints in class HttpContextHttpExceptionIOExceptionpublic String getLocaleEncoding(Locale locale)
locale - a Locale valueString representing the character encoding for
the locale or null if none found.public String toString()
toString in class HttpContextpublic void sendError(HttpResponse response, int code, String msg) throws IOException
HttpContextsendError in class HttpContextresponse - the response to sendcode - The error codemsg - The message for the error or null for the defaultIOException - Problem sending response.public void destroy()
HttpContextdestroy in class HttpContextpublic Object enterContextScope(HttpRequest request, HttpResponse response)
HttpContextenterContextScope in class HttpContextprotected void doStop()
throws Exception
HttpContextdoStop in class HttpContextExceptionCopyright © 2014. All rights reserved.