com.getsnappy.snappyj
Class ApplicationInstance

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.getsnappy.snappyj.ApplicationInstance
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public abstract class ApplicationInstance
extends javax.servlet.http.HttpServlet

This class as a wrapper around HttpServlet is slightly more convenient and plays nicer with Eclipse than the HttpServlet class. This class is strictly optional, but I find the error handling mechanisms quite useful.

Author:
brian
See Also:
Serialized Form

Constructor Summary
ApplicationInstance()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          simply forward to the output function and turn exceptions that are not already of type IOException or ServletException into ServletExceptions before passing them back out.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          simply forward to the output function and turn exceptions that are not already of type IOException or ServletException into ServletExceptions before passing them back out.
abstract  void output(java.io.Writer out, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This abstract class must be overriden and is called whenever this servlet is excecuted.
 void setApplicationErrorHandler(ApplicationErrorHandler error)
          Specify an alternate error handler.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationInstance

public ApplicationInstance()
Method Detail

setApplicationErrorHandler

public void setApplicationErrorHandler(ApplicationErrorHandler error)
Specify an alternate error handler. The handleError method of this error handler is called any time an exception is thrown out of output

Parameters:
error - is the new ApplicationErrorHandler

output

public abstract void output(java.io.Writer out,
                            javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response)
                     throws java.lang.Exception
This abstract class must be overriden and is called whenever this servlet is excecuted.

Parameters:
out -
request -
response -
Throws:
java.lang.Exception

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
simply forward to the output function and turn exceptions that are not already of type IOException or ServletException into ServletExceptions before passing them back out.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
java.io.IOException
javax.servlet.ServletException

doPost

public final void doPost(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws java.io.IOException,
                         javax.servlet.ServletException
simply forward to the output function and turn exceptions that are not already of type IOException or ServletException into ServletExceptions before passing them back out.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
java.io.IOException
javax.servlet.ServletException