org.eclipse.jetty.server.handler
类 ErrorHandler

java.lang.Object
  继承者 org.eclipse.jetty.util.component.AbstractLifeCycle
      继承者 org.eclipse.jetty.util.component.AggregateLifeCycle
          继承者 org.eclipse.jetty.server.handler.AbstractHandler
              继承者 org.eclipse.jetty.server.handler.ErrorHandler
所有已实现的接口:
Handler, Destroyable, Dumpable, LifeCycle
直接已知子类:
ErrorPageErrorHandler

public class ErrorHandler
extends AbstractHandler

Handler for Error pages An ErrorHandler is registered with ContextHandler.setErrorHandler(ErrorHandler) or Server.addBean(Object). It is called by the HttpResponse.sendError method to write a error page.


嵌套类摘要
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的嵌套类/接口
AbstractLifeCycle.AbstractLifeCycleListener
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口
LifeCycle.Listener
 
字段摘要
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的字段
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
 
构造方法摘要
ErrorHandler()
           
 
方法摘要
 String getCacheControl()
          Get the cacheControl.
 boolean getShowMessageInTitle()
           
 void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
          Handle a request.
protected  void handleErrorPage(HttpServletRequest request, Writer writer, int code, String message)
           
 boolean isShowStacks()
           
 void setCacheControl(String cacheControl)
          Set the cacheControl.
 void setShowMessageInTitle(boolean showMessageInTitle)
           
 void setShowStacks(boolean showStacks)
           
protected  void write(Writer writer, String string)
           
protected  void writeErrorPage(HttpServletRequest request, Writer writer, int code, String message, boolean showStacks)
           
protected  void writeErrorPageBody(HttpServletRequest request, Writer writer, int code, String message, boolean showStacks)
           
protected  void writeErrorPageHead(HttpServletRequest request, Writer writer, int code, String message)
           
protected  void writeErrorPageMessage(HttpServletRequest request, Writer writer, int code, String message, String uri)
           
protected  void writeErrorPageStacks(HttpServletRequest request, Writer writer)
           
 
从类 org.eclipse.jetty.server.handler.AbstractHandler 继承的方法
destroy, doStart, doStop, dumpThis, getServer, setServer
 
从类 org.eclipse.jetty.util.component.AggregateLifeCycle 继承的方法
addBean, addBean, contains, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, unmanage
 
从类 org.eclipse.jetty.util.component.AbstractLifeCycle 继承的方法
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的方法
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

构造方法详细信息

ErrorHandler

public ErrorHandler()
方法详细信息

handle

public void handle(String target,
                   Request baseRequest,
                   HttpServletRequest request,
                   HttpServletResponse response)
            throws IOException
从接口 Handler 复制的描述
Handle a request.

参数:
target - The target of the request - either a URI or a name.
baseRequest - The original unwrapped request object.
request - The request either as the Request object or a wrapper of that request. The AbstractHttpConnection.getCurrentConnection() method can be used access the Request object if required.
response - The response as the Response object or a wrapper of that request. The AbstractHttpConnection.getCurrentConnection() method can be used access the Response object if required.
抛出:
IOException

handleErrorPage

protected void handleErrorPage(HttpServletRequest request,
                               Writer writer,
                               int code,
                               String message)
                        throws IOException
抛出:
IOException

writeErrorPage

protected void writeErrorPage(HttpServletRequest request,
                              Writer writer,
                              int code,
                              String message,
                              boolean showStacks)
                       throws IOException
抛出:
IOException

writeErrorPageHead

protected void writeErrorPageHead(HttpServletRequest request,
                                  Writer writer,
                                  int code,
                                  String message)
                           throws IOException
抛出:
IOException

writeErrorPageBody

protected void writeErrorPageBody(HttpServletRequest request,
                                  Writer writer,
                                  int code,
                                  String message,
                                  boolean showStacks)
                           throws IOException
抛出:
IOException

writeErrorPageMessage

protected void writeErrorPageMessage(HttpServletRequest request,
                                     Writer writer,
                                     int code,
                                     String message,
                                     String uri)
                              throws IOException
抛出:
IOException

writeErrorPageStacks

protected void writeErrorPageStacks(HttpServletRequest request,
                                    Writer writer)
                             throws IOException
抛出:
IOException

getCacheControl

public String getCacheControl()
Get the cacheControl.

返回:
the cacheControl header to set on error responses.

setCacheControl

public void setCacheControl(String cacheControl)
Set the cacheControl.

参数:
cacheControl - the cacheControl header to set on error responses.

isShowStacks

public boolean isShowStacks()
返回:
True if stack traces are shown in the error pages

setShowStacks

public void setShowStacks(boolean showStacks)
参数:
showStacks - True if stack traces are shown in the error pages

setShowMessageInTitle

public void setShowMessageInTitle(boolean showMessageInTitle)
参数:
showMessageInTitle - if true, the error message appears in page title

getShowMessageInTitle

public boolean getShowMessageInTitle()

write

protected void write(Writer writer,
                     String string)
              throws IOException
抛出:
IOException


Copyright © 2013. All Rights Reserved.