org.apache.velocity.app.event.implement
Class PrintExceptions
java.lang.Object
org.apache.velocity.app.event.implement.PrintExceptions
- All Implemented Interfaces:
- EventHandler, MethodExceptionEventHandler, RuntimeServicesAware
public class PrintExceptions
- extends Object
- implements MethodExceptionEventHandler, RuntimeServicesAware
Simple event handler that renders method exceptions in the page
rather than throwing the exception. Useful for debugging.
By default this event handler renders the exception name only.
To include both the exception name and the message, set the property
eventhandler.methodexception.message
to true
. To render
the stack trace, set the property eventhandler.methodexception.stacktrace
to true
.
- Since:
- 1.5
- Version:
- $Id: PrintExceptions.java 685685 2008-08-13 21:43:27Z nbubna $
- Author:
- Will Glass-Husain
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PrintExceptions
public PrintExceptions()
methodException
public Object methodException(Class claz,
String method,
Exception e)
throws Exception
- Render the method exception, and optionally the exception message and stack trace.
- Specified by:
methodException
in interface MethodExceptionEventHandler
- Parameters:
claz
- the class of the object the method is being applied tomethod
- the methode
- the thrown exception
- Returns:
- an object to insert in the page
- Throws:
Exception
- an exception to be thrown instead inserting an object
setRuntimeServices
public void setRuntimeServices(RuntimeServices rs)
- Description copied from interface:
RuntimeServicesAware
- Called automatically when event cartridge is initialized.
- Specified by:
setRuntimeServices
in interface RuntimeServicesAware
- Parameters:
rs
- RuntimeServices object assigned during initialization- See Also:
RuntimeServicesAware.setRuntimeServices(org.apache.velocity.runtime.RuntimeServices)
Copyright © 2000-2010 The Apache Software Foundation. All Rights Reserved.