jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.htform
Class WithExceptionHandlerServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byuk.co.weft.maybeupload.MaybeUploadServlet
              extended byuk.co.weft.htform.Servlet
                  extended byuk.co.weft.htform.WithExceptionHandlerServlet
All Implemented Interfaces:
ResourceConsumer, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
DocPage, Page

public abstract class WithExceptionHandlerServlet
extends Servlet

A class which abstracts out exception handling from more specialised Jacquard servlets. Essentially, this class does nothing unless some class further up the stack throws an exception which is not caught. If this happens this class takes over and either handles the exception tidily itself or passes it to a registered ExceptionHandler.

This class and consequently its subclasses knows about the following configuration parameter:

exception_handler_class
String: the name of the class, implementing the ExceptionHandler interface, which I should use as an exception handler. Obviously the class must exist on the class path. Optional. Defaults to uk.co.weft.exceptionhandler.JustWhingeExceptionHandler.

See Also:
Serialized Form

Field Summary
static java.lang.String EXCEPTIONHANDLERCLASSCONFIGTOKEN
          a token on which to look in the configuration for the name of the exception handler class to use
 
Fields inherited from class uk.co.weft.htform.Servlet
calendar, conf, contentType, CONTENTTYPECONFIGTOKEN, cookieDomain, cookiePath, COOKIESCONFIGTOKEN, cookieTTL, dbPassword, dbUrl, dbUsername, debug, DEBUGCONFIGTOKEN, driverName, embedded, here, identity, localeMagicToken, LOCALEMAGICTOKEN, outputStreamMagicToken, OUTPUTSTREAMMAGICTOKEN, parsePathInfo, PATHINFOMAGICTOKEN, ready, redirectMagicToken, REDIRECTMAGICTOKEN, requestMagicToken, REQUESTMAGICTOKEN, resourceBundleName, responseMagicToken, RESPONSEMAGICTOKEN, servletMagicToken, SERVLETMAGICTOKEN, sessionMagicToken, SESSIONMAGICTOKEN, USEHTTPSCONFIGTOKEN, zone
 
Fields inherited from class uk.co.weft.maybeupload.MaybeUploadServlet
allowOverwrite, maxUpload, saveUploadedFilesToDisk, silentlyRename, uploadDir, uploadDirPath, uploadDirURL
 
Fields inherited from interface uk.co.weft.htform.ResourceConsumer
RESOURCEBUNDLEMAGICTOKEN
 
Constructor Summary
WithExceptionHandlerServlet()
           
 
Method Summary
 void init(Context config)
          Read my configuration
protected  void whinge(javax.servlet.ServletOutputStream out, java.lang.Exception e)
          Deprecated. use whinge(ServletOutputStream,Exception,Context,boolean)
protected  void whinge(javax.servlet.ServletOutputStream out, java.lang.Exception e, Context context)
          Deprecated. use whinge(ServletOutputStream,Exception,Context,boolean)
protected  void whinge(javax.servlet.ServletOutputStream out, java.lang.Exception e, Context context, boolean inprogress)
          Last line-of-defence error reporter.
 
Methods inherited from class uk.co.weft.htform.Servlet
addCookie, addCookie, coerceCookiesToContext, coerceToContext, coerceToContext, coerceToContext, coerceToContext, coerceToUrl, createContext, doGet, doPost, fixupMagicValues, generateContent, getCalendar, getContentType, getDebug, getLocale, getOutputStream, getResource, getResourceString, getServletInfo, grs, grs, handleAction, handleCookies, handleRedirect, init, makeReady, outputRedirectBlock, setCookieValues, storeOnSession
 
Methods inherited from class uk.co.weft.maybeupload.MaybeUploadServlet
doDelete, doHead, doOptions, doPut, doTrace, getUploadDir, getUploadURL, service
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXCEPTIONHANDLERCLASSCONFIGTOKEN

public static final java.lang.String EXCEPTIONHANDLERCLASSCONFIGTOKEN
a token on which to look in the configuration for the name of the exception handler class to use

See Also:
Constant Field Values
Constructor Detail

WithExceptionHandlerServlet

public WithExceptionHandlerServlet()
Method Detail

init

public void init(Context config)
          throws InitialisationException
Read my configuration

Overrides:
init in class Servlet
Throws:
InitialisationException

whinge

protected void whinge(javax.servlet.ServletOutputStream out,
                      java.lang.Exception e)
               throws javax.servlet.ServletException
Deprecated. use whinge(ServletOutputStream,Exception,Context,boolean)

Last line-of-defence error reporter.

Overrides:
whinge in class Servlet
Parameters:
out - an output stream to print on
e - an exception to whinge about
Throws:
javax.servlet.ServletException

whinge

protected void whinge(javax.servlet.ServletOutputStream out,
                      java.lang.Exception e,
                      Context context)
               throws javax.servlet.ServletException
Deprecated. use whinge(ServletOutputStream,Exception,Context,boolean)

Last line-of-defence error reporter.

Overrides:
whinge in class Servlet
Parameters:
out - an output stream to print on
e - an exception to whinge about
context - the context in which the problem occurred.
Throws:
javax.servlet.ServletException

whinge

protected void whinge(javax.servlet.ServletOutputStream out,
                      java.lang.Exception e,
                      Context context,
                      boolean inprogress)
               throws javax.servlet.ServletException
Last line-of-defence error reporter. .

Parameters:
out - an output stream to print on
e - an exception to whinge about
context - the context in which the problem occurred.
inprogress - true if the exception happened when the page was already in the process of being generated, and the HEAD section has alreade been sent; else false.
Throws:
javax.servlet.ServletException

jacquard 1.12.0 by The Web Engineering Factory and Toolworks