freemarker.ext.misc
Class HtmlFormattedExceptionListener

java.lang.Object
  |
  +--freemarker.ext.misc.HtmlFormattedExceptionListener
All Implemented Interfaces:
java.util.EventListener, TemplateExceptionListener

public class HtmlFormattedExceptionListener
extends java.lang.Object
implements TemplateExceptionListener

Exception listener that improves reporting for compile errors. Modified error reporting so that errors detected at compile time are returned as an entire HTML page rather than a comment. The error text is displayed on the page (not inside of a comment).

Version:
$Id: HtmlFormattedExceptionListener.java,v 1.4 2003/11/17 13:06:24 run2000 Exp $
Author:
Nicholas Cull, based on code by Dan Milstein

Constructor Summary
HtmlFormattedExceptionListener()
          Creates a new instance of HtmlFormattedExceptionListener
 
Method Summary
 void exceptionThrown(TemplateExceptionEvent e)
          Handles events that are created whenever an exception is thrown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlFormattedExceptionListener

public HtmlFormattedExceptionListener()
Creates a new instance of HtmlFormattedExceptionListener
Method Detail

exceptionThrown

public void exceptionThrown(TemplateExceptionEvent e)
Handles events that are created whenever an exception is thrown. This handler turns the event into either an HTML comment, or a fully-formed HTML page, depending on whether its a compile-time or run-time error. The result is inserted into the current output stream of the Template.
Specified by:
exceptionThrown in interface TemplateExceptionListener