SimpleServlets v5.5.0

com.simpleservlets.pageprocessor
Class GenericErrorPage

java.lang.Object
  extended by com.simpleservlets.pageprocessor.HTMLObjectsPageHandler
      extended by com.simpleservlets.pageprocessor.GenericErrorPage
All Implemented Interfaces:
PageHandler

public class GenericErrorPage
extends HTMLObjectsPageHandler

Page shown (by default) when an unexpected error occurs. Developers are free to override this default by using the PageProcessor.setErrorPage(PageHandler).

Author:
Paul Hyde

Field Summary
 
Fields inherited from class com.simpleservlets.pageprocessor.HTMLObjectsPageHandler
defaultPageBackgroundColor, defaultTitle
 
Constructor Summary
GenericErrorPage()
          Builds an error page that does allow the stack trace details to be shown to the user when the user click on a "detail" link.
GenericErrorPage(boolean allowDetailToBeShown)
          Builds an error page that either does or does not allow the stack trace details to be shown to the user when the user click on a "detail" link.
 
Method Summary
 void processRequest(PageContext pc, HTMLElement con)
          This method is called whenever there is a request aimed at this page.
 
Methods inherited from class com.simpleservlets.pageprocessor.HTMLObjectsPageHandler
createFooter, createHeader, getPageBackgroundColor, getTitle, processRequest, sendPage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericErrorPage

public GenericErrorPage(boolean allowDetailToBeShown)
Builds an error page that either does or does not allow the stack trace details to be shown to the user when the user click on a "detail" link.


GenericErrorPage

public GenericErrorPage()
Builds an error page that does allow the stack trace details to be shown to the user when the user click on a "detail" link.

Method Detail

processRequest

public void processRequest(PageContext pc,
                           HTMLElement con)
                    throws PageProcessorException
Description copied from class: HTMLObjectsPageHandler
This method is called whenever there is a request aimed at this page. Subclasses override this method and fill up the specified container: con with the main content of the page. The subclass should then call HTMLObjectsPageHandler.sendPage(PageContext, HTMLElement) to deliver this page to the browser.

This class' implementation (when not overridden) always throws a PageProcessorException to indicate that the page is not permitted to be accessed directly. Subclasses override this method to allow a page to be directly requested.

Overrides:
processRequest in class HTMLObjectsPageHandler
Parameters:
pc - the context of the request/response cycle
con - the container to fill up with the page's content
Throws:
PageProcessorException - can be optionally thrown to indicate that the page could not be created.

SimpleServlets v5.5.0

Copyright © 2001-2007 Programix Incorporated. All rights reserved. SimpleServlets is free and is OSI Certified Open Source Software under the BSD license.