public class ServletHandler extends HttpHandler
Modifier and Type | Field and Description |
---|---|
protected ClassLoader |
classLoader |
protected ExpectationHandler |
expectationHandler |
protected FilterChainFactory |
filterChainFactory |
protected boolean |
initialize
Initialize the
ServletContext |
protected Map<String,Object> |
properties
Holder for our configured properties.
|
protected Class<? extends javax.servlet.Servlet> |
servletClass |
protected 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,
String message,
int errorCode,
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) |
ClassLoader |
getClassLoader() |
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) |
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(ClassLoader classLoader) |
void |
setContextPath(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(Class<? extends javax.servlet.Servlet> servletClass) |
protected void |
setServletClassName(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, updatePaths
protected String servletClassName
protected Class<? extends javax.servlet.Servlet> servletClass
protected volatile javax.servlet.Servlet servletInstance
protected boolean initialize
ServletContext
protected ClassLoader classLoader
protected ExpectationHandler expectationHandler
protected FilterChainFactory filterChainFactory
protected ServletHandler(ServletConfigImpl servletConfig)
public void start()
start
in class HttpHandler
protected boolean sendAcknowledgment(Request request, Response response) throws 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 HttpHandler
IOException
public void service(Request request, Response response) throws Exception
service
in class HttpHandler
Exception
protected FilterChainInvoker getFilterChain(Request request)
protected void setPathData(Request from, HttpServletRequestImpl to)
public void customizeErrorPage(Response response, String message, int errorCode, Throwable t)
response
- the Response
message
- 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 ServletConfigImpl
javax.servlet.ServletException
- Error while configuring
Servlet
.public javax.servlet.Servlet getServletInstance()
Servlet
instance used by this ServletHandler
Servlet
instance.protected void setServletInstance(javax.servlet.Servlet servletInstance)
Servlet
instance used by this ServletHandler
servletInstance
- an instance of Servlet.protected void setServletClassName(String servletClassName)
protected void setServletClass(Class<? extends javax.servlet.Servlet> servletClass)
public 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(String contextPath)
contextPath
- Context path.public void destroy()
ServletContextListener
destroy
in class HttpHandler
protected WebappContext getServletCtx()
public ClassLoader getClassLoader()
public void setClassLoader(ClassLoader classLoader)
public ServletConfigImpl getServletConfig()
public String getName()
getName
in class HttpHandler
public 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 HttpHandler
protected void setFilterChainFactory(FilterChainFactory filterChainFactory)
Copyright © 2014 Oracle Corporation. All Rights Reserved.