public class ServletHandler extends HttpHandler
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.ClassLoader |
classLoader |
protected ExpectationHandler |
expectationHandler |
protected FilterChainFactory |
filterChainFactory |
protected boolean |
initialize
Initialize the
ServletContext |
protected java.util.Map<java.lang.String,java.lang.Object> |
properties
Holder for our configured properties.
|
protected java.lang.Class<? extends javax.servlet.Servlet> |
servletClass |
protected java.lang.String |
servletClassName |
protected javax.servlet.Servlet |
servletInstance |
| Modifier | Constructor and Description |
|---|---|
protected |
ServletHandler(ServletConfigImpl servletConfig) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureServletEnv()
Configure the
WebappContext
and ServletConfigImpl |
void |
customizeErrorPage(Response response,
java.lang.String message,
int errorCode,
java.lang.Throwable t)
Customize the error page returned to the client.
|
void |
destroy()
Destroy this Servlet and its associated
ServletContextListener |
protected void |
doServletService(Request request,
Response response) |
java.lang.ClassLoader |
getClassLoader() |
java.lang.String |
getContextPath()
Returns the portion of the request URI that indicates the context
of the request.
|
ExpectationHandler |
getExpectationHandler()
Get the
ExpectationHandler responsible for processing
Expect: header (for example "Expect: 100-Continue"). |
protected FilterChainInvoker |
getFilterChain(Request request) |
java.lang.String |
getName() |
ServletConfigImpl |
getServletConfig() |
protected WebappContext |
getServletCtx() |
javax.servlet.Servlet |
getServletInstance()
Return the
Servlet instance used by this ServletHandler |
protected void |
loadServlet()
Load a
Servlet instance. |
protected boolean |
sendAcknowledgment(Request request,
Response response)
Override parent's
HttpHandler.sendAcknowledgment(org.glassfish.grizzly.http.server.Request, org.glassfish.grizzly.http.server.Response)
to let ExpectationHandler (if one is registered) process the expectation. |
void |
service(Request request,
Response response) |
void |
setClassLoader(java.lang.ClassLoader classLoader) |
void |
setContextPath(java.lang.String contextPath)
Programmatically set the context path of the Servlet.
|
protected void |
setDispatcherHelper(DispatcherHelper dispatcherHelper) |
void |
setExpectationHandler(ExpectationHandler expectationHandler)
Set the
ExpectationHandler responsible for processing
Expect: header (for example "Expect: 100-Continue"). |
protected void |
setFilterChainFactory(FilterChainFactory filterChainFactory) |
protected void |
setPathData(Request from,
HttpServletRequestImpl to) |
protected void |
setServletClass(java.lang.Class<? extends javax.servlet.Servlet> servletClass) |
protected void |
setServletClassName(java.lang.String servletClassName) |
protected void |
setServletInstance(javax.servlet.Servlet servletInstance)
Set the
Servlet instance used by this ServletHandler |
void |
start() |
getErrorPageGenerator, getRequestExecutorProvider, getRequestURIEncoding, isAllowCustomStatusMessage, isAllowEncodedSlash, setAllowCustomStatusMessage, setAllowEncodedSlash, setDecodeUrl, setRequestURIEncoding, setRequestURIEncoding, updatePathsprotected java.lang.String servletClassName
protected java.lang.Class<? extends javax.servlet.Servlet> servletClass
protected volatile javax.servlet.Servlet servletInstance
protected final java.util.Map<java.lang.String,java.lang.Object> properties
protected boolean initialize
ServletContextprotected java.lang.ClassLoader classLoader
protected ExpectationHandler expectationHandler
protected FilterChainFactory filterChainFactory
protected ServletHandler(ServletConfigImpl servletConfig)
public void start()
start in class HttpHandlerprotected boolean sendAcknowledgment(Request request, Response response) throws java.io.IOException
HttpHandler.sendAcknowledgment(org.glassfish.grizzly.http.server.Request, org.glassfish.grizzly.http.server.Response)
to let ExpectationHandler (if one is registered) process the expectation.sendAcknowledgment in class HttpHandlerjava.io.IOExceptionpublic void service(Request request, Response response) throws java.lang.Exception
service in class HttpHandlerjava.lang.Exceptionprotected FilterChainInvoker getFilterChain(Request request)
protected void setPathData(Request from, HttpServletRequestImpl to)
public void customizeErrorPage(Response response, java.lang.String message, int errorCode, java.lang.Throwable t)
response - the Responsemessage - the HTTP error messageerrorCode - the error code.protected void loadServlet()
throws javax.servlet.ServletException
Servlet instance.javax.servlet.ServletException - If failed to
Servlet.init(javax.servlet.ServletConfig).protected void configureServletEnv()
throws javax.servlet.ServletException
WebappContext
and ServletConfigImpljavax.servlet.ServletException - Error while configuring
Servlet.public javax.servlet.Servlet getServletInstance()
Servlet instance used by this ServletHandlerServlet instance.protected void setServletInstance(javax.servlet.Servlet servletInstance)
Servlet instance used by this ServletHandlerservletInstance - an instance of Servlet.protected void setServletClassName(java.lang.String servletClassName)
protected void setServletClass(java.lang.Class<? extends javax.servlet.Servlet> servletClass)
public java.lang.String getContextPath()
It is possible that a servlet container may match a context by
more than one context path. In such cases this method will return the
actual context path used by the request and it may differ from the
path returned by the
ServletContext.getContextPath() method.
The context path returned by
ServletContext.getContextPath()
should be considered as the prime or preferred context path of the
application.
String specifying the
portion of the request URI that indicates the context
of the requestServletContext.getContextPath()public void setContextPath(java.lang.String contextPath)
contextPath - Context path.public void destroy()
ServletContextListenerdestroy in class HttpHandlerprotected WebappContext getServletCtx()
public java.lang.ClassLoader getClassLoader()
public void setClassLoader(java.lang.ClassLoader classLoader)
public ServletConfigImpl getServletConfig()
public java.lang.String getName()
getName in class HttpHandlerpublic ExpectationHandler getExpectationHandler()
ExpectationHandler responsible for processing
Expect: header (for example "Expect: 100-Continue").ExpectationHandler responsible for processing
Expect: header (for example "Expect: 100-Continue").public void setExpectationHandler(ExpectationHandler expectationHandler)
ExpectationHandler responsible for processing
Expect: header (for example "Expect: 100-Continue").expectationHandler - the ExpectationHandler responsible
for processing Expect: header (for example "Expect: 100-Continue").protected void setDispatcherHelper(DispatcherHelper dispatcherHelper)
setDispatcherHelper in class HttpHandlerprotected void setFilterChainFactory(FilterChainFactory filterChainFactory)
Copyright © 2014 Oracle Corporation. All Rights Reserved.