org.apache.tomcat.modules.generators
Class ErrorHandler

java.lang.Object
  extended byorg.apache.tomcat.core.BaseInterceptor
      extended byorg.apache.tomcat.modules.generators.ErrorHandler

public final class ErrorHandler
extends BaseInterceptor

Handle errors - this is the default handler, you can replace it with customized versions

Author:
Costin Manolache

Field Summary
 
Fields inherited from class org.apache.tomcat.core.BaseInterceptor
cm, ct, ctx, debug, DECLINED, loghelper, OK
 
Constructor Summary
ErrorHandler()
           
 
Method Summary
 void contextInit(Context ctx)
          Add default error handlers
 void engineInit(ContextManager cm)
          Initialize the module.
 void engineStart(ContextManager cm)
          Check that we are in a stable state.
 Handler getHandlerForPath(ContextManager cm, Context ctx, java.lang.String path)
           
 int handleError(Request req, Response res, java.lang.Throwable t)
          This callback is called whenever an exception happen.
 void setDefaultRedirectStatus(java.lang.String s)
           
 void setShowDebugInfo(boolean b)
           
 
Methods inherited from class org.apache.tomcat.core.BaseInterceptor
addContainer, addContext, addHandler, addInterceptor, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, beforeCommit, contextMap, contextShutdown, contextState, copyContext, engineShutdown, engineState, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, log, log, log, log, postInitCheck, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preInitCheck, preService, preServletDestroy, preServletInit, registerHooks, reload, removeContainer, removeContext, removeHandler, removeInterceptor, requestMap, sessionState, setContext, setContextManager, setDebug, setInfo, setNote, setNote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorHandler

public ErrorHandler()
Method Detail

setShowDebugInfo

public void setShowDebugInfo(boolean b)

setDefaultRedirectStatus

public void setDefaultRedirectStatus(java.lang.String s)

engineInit

public void engineInit(ContextManager cm)
Description copied from class: BaseInterceptor
Initialize the module.

Overrides:
engineInit in class BaseInterceptor

engineStart

public void engineStart(ContextManager cm)
                 throws TomcatException
Check that we are in a stable state.

Overrides:
engineStart in class BaseInterceptor
Throws:
TomcatException

contextInit

public void contextInit(Context ctx)
                 throws TomcatException
Add default error handlers

Overrides:
contextInit in class BaseInterceptor
Throws:
TomcatException

handleError

public int handleError(Request req,
                       Response res,
                       java.lang.Throwable t)
Description copied from class: BaseInterceptor
This callback is called whenever an exception happen. If t is null assume this is a "status" report ( 500, 404, etc). During this hook it is possible to create a sub-request and call the handler, and it is possible that the sub-request will also generate an exception. The handler must insure no loops will happen - but it's free to choose whatever method it wants. It's also the handler responsiblity to insure correct servlet API semantics - if the spec becomes incopmatible with previous versions ( or multiple interpretations are possible) that can be made a context-specific handler.

Overrides:
handleError in class BaseInterceptor

getHandlerForPath

public final Handler getHandlerForPath(ContextManager cm,
                                       Context ctx,
                                       java.lang.String path)


Copyright ? 2001 Apache Software Foundation. All Rights Reserved.