org.apache.beehive.netui.util
Class HtmlExceptionFormatter

Object
  extended by HtmlExceptionFormatter

public class HtmlExceptionFormatter
extends Object

Format a Throwable so that it displays well in HTML.


Constructor Summary
HtmlExceptionFormatter()
           
 
Method Summary
static String format(String message, Throwable t, boolean includeStackTrace)
          Format an exception into XHTML.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlExceptionFormatter

public HtmlExceptionFormatter()
Method Detail

format

public static String format(String message,
                            Throwable t,
                            boolean includeStackTrace)
Format an exception into XHTML.

Optionally include a message and the stack trace.

The formatted exception will have line breaks replaced with XHTML line breaks for display in HTML. The String message of the cause will be included, and the stack trace of the cause is optionally included given the value of includeStackTrace

Parameters:
message - the message to include with the formatted exception. This is in addition to the message in the stack trace.
t - a Throwable exception to format
includeStackTrace - a boolean that determines whether to include the stack trace in the formatted output
Returns:
the formatted error message, optionally including the stack trace.