org.archive.wayback.exception
Class BaseExceptionRenderer

java.lang.Object
  extended by org.archive.wayback.exception.BaseExceptionRenderer
All Implemented Interfaces:
ExceptionRenderer
Direct Known Subclasses:
AnnotationExceptionRenderer, CustomNotInArchiveExceptionRenderer

public class BaseExceptionRenderer
extends Object
implements ExceptionRenderer

Default implementation responsible for outputting error responses to users for expected failure situations, for both Replay and Query requests. Has logic to return errors as XML, if in query mode, and if user requested XML. Has logic to render errors as CSS, Javascript, and blank images, if the request is Replay mode, embedded, and of an obvious type from the request URL

Version:
$Date: 2010-09-29 05:28:38 +0700 (Wed, 29 Sep 2010) $, $Revision: 3262 $
Author:
brad

Field Summary
protected  Pattern IMAGE_REGEX
           
 
Constructor Summary
BaseExceptionRenderer()
           
 
Method Summary
 String getCssErrorJsp()
           
 String getErrorJsp()
           
 String getImageErrorJsp()
           
 String getJavascriptErrorJsp()
           
 String getXmlErrorJsp()
           
 void renderException(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, WaybackRequest wbRequest, WaybackException exception, ResultURIConverter uriConverter)
          Render the contents of a WaybackException in either html, javascript, or css format, depending on the guessed context, so errors in embedded documents do not cause unneeded errors in the embedding document.
protected  boolean requestIsCSS(javax.servlet.http.HttpServletRequest httpRequest, WaybackRequest wbRequest)
           
protected  boolean requestIsEmbedded(javax.servlet.http.HttpServletRequest httpRequest, WaybackRequest wbRequest)
           
protected  boolean requestIsImage(javax.servlet.http.HttpServletRequest httpRequest, WaybackRequest wbRequest)
           
protected  boolean requestIsJavascript(javax.servlet.http.HttpServletRequest httpRequest, WaybackRequest wbRequest)
           
 void setCssErrorJsp(String cssErrorJsp)
           
 void setErrorJsp(String errorJsp)
           
 void setImageErrorJsp(String imageErrorJsp)
           
 void setJavascriptErrorJsp(String javascriptErrorJsp)
           
 void setXmlErrorJsp(String xmlErrorJsp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGE_REGEX

protected final Pattern IMAGE_REGEX
Constructor Detail

BaseExceptionRenderer

public BaseExceptionRenderer()
Method Detail

requestIsEmbedded

protected boolean requestIsEmbedded(javax.servlet.http.HttpServletRequest httpRequest,
                                    WaybackRequest wbRequest)

requestIsImage

protected boolean requestIsImage(javax.servlet.http.HttpServletRequest httpRequest,
                                 WaybackRequest wbRequest)

requestIsJavascript

protected boolean requestIsJavascript(javax.servlet.http.HttpServletRequest httpRequest,
                                      WaybackRequest wbRequest)

requestIsCSS

protected boolean requestIsCSS(javax.servlet.http.HttpServletRequest httpRequest,
                               WaybackRequest wbRequest)

renderException

public void renderException(javax.servlet.http.HttpServletRequest httpRequest,
                            javax.servlet.http.HttpServletResponse httpResponse,
                            WaybackRequest wbRequest,
                            WaybackException exception,
                            ResultURIConverter uriConverter)
                     throws javax.servlet.ServletException,
                            IOException
Description copied from interface: ExceptionRenderer
Render the contents of a WaybackException in either html, javascript, or css format, depending on the guessed context, so errors in embedded documents do not cause unneeded errors in the embedding document.

Specified by:
renderException in interface ExceptionRenderer
Parameters:
httpRequest - from Servlet handling
httpResponse - from Servlet handling
wbRequest - as parsed by RequestParser
exception - specific WaybackException subclass thrown
uriConverter - for the AccessPoint handling the request
Throws:
javax.servlet.ServletException - per usual
IOException - per usual

getErrorJsp

public String getErrorJsp()

setErrorJsp

public void setErrorJsp(String errorJsp)

getXmlErrorJsp

public String getXmlErrorJsp()
Returns:
the xmlErrorJsp

setXmlErrorJsp

public void setXmlErrorJsp(String xmlErrorJsp)
Parameters:
xmlErrorJsp - the xmlErrorJsp to set

getImageErrorJsp

public String getImageErrorJsp()

setImageErrorJsp

public void setImageErrorJsp(String imageErrorJsp)

getJavascriptErrorJsp

public String getJavascriptErrorJsp()

setJavascriptErrorJsp

public void setJavascriptErrorJsp(String javascriptErrorJsp)

getCssErrorJsp

public String getCssErrorJsp()

setCssErrorJsp

public void setCssErrorJsp(String cssErrorJsp)


Copyright © 2005-2011 Internet Archive. All Rights Reserved.