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, toString
addComponent, addEventListener, getComponents, isStarted, isStarting, isStopping, removeComponent, removeEventListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isStarted, start, stop
addEventListener, removeEventListener
public 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.ClassNotFoundException
InstantiationException
IllegalAccessException
public 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.ClassNotFoundException
InstantiationException
IllegalAccessException
protected boolean jSecurityCheck(String pathInContext, HttpRequest request, HttpResponse response) throws IOException
IOException
public boolean checkSecurityConstraints(String pathInContext, HttpRequest request, HttpResponse response) throws HttpException, IOException
checkSecurityConstraints
in class HttpContext
HttpException
IOException
public 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 HttpContext
public void sendError(HttpResponse response, int code, String msg) throws IOException
HttpContext
sendError
in class HttpContext
response
- the response to sendcode
- The error codemsg
- The message for the error or null for the defaultIOException
- Problem sending response.public void destroy()
HttpContext
destroy
in class HttpContext
public Object enterContextScope(HttpRequest request, HttpResponse response)
HttpContext
enterContextScope
in class HttpContext
protected void doStop() throws Exception
HttpContext
doStop
in class HttpContext
Exception
Copyright © 2016. All Rights Reserved.