freemarker.template
Class HtmlExceptionListener

java.lang.Object
  |
  +--freemarker.template.HtmlExceptionListener
All Implemented Interfaces:
java.util.EventListener, TemplateExceptionListener

public final class HtmlExceptionListener
extends java.lang.Object
implements TemplateExceptionListener

A basic handler that matches FreeMarker template legacy behaviour: any exceptions thrown by FM-Classic are output inside an HTML comment within the body of the output.

Version:
$Id$
Author:
Nicholas Cull

Constructor Summary
HtmlExceptionListener()
          Deprecated. use the getInstance() method instead
 
Method Summary
 void exceptionThrown(TemplateExceptionEvent e)
          Handles events that are created whenever an exception is thrown.
static HtmlExceptionListener getInstance()
          Retrieves a singleton instance of this HTML exception listener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlExceptionListener

public HtmlExceptionListener()
Deprecated. use the getInstance() method instead

Creates new HtmlExceptionListener.
Method Detail

getInstance

public static HtmlExceptionListener getInstance()
Retrieves a singleton instance of this HTML exception listener
Returns:
a singleton instance of this class

exceptionThrown

public void exceptionThrown(TemplateExceptionEvent e)
Handles events that are created whenever an exception is thrown. This handler turns the event into an HTML comment, and is inserted into the current output stream of the Template.
Specified by:
exceptionThrown in interface TemplateExceptionListener