com.opensymphony.xwork2.interceptor
public class: ExceptionHolder [javadoc |
source]
java.lang.Object
com.opensymphony.xwork2.interceptor.ExceptionHolder
All Implemented Interfaces:
Serializable
A simple wrapper around an exception, providing an easy way to print out the stack trace of the exception as well as
a way to get a handle on the exception itself.
- author:
Matthew
- E. Porter (matthew dot porter at metissian dot com)
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from com.opensymphony.xwork2.interceptor.ExceptionHolder Detail: |
public Exception getException() {
return this.exception;
}
Gets the holded exception |
public String getExceptionStack() {
String exceptionStack = null;
if (getException() != null) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
try {
getException().printStackTrace(pw);
exceptionStack = sw.toString();
}
finally {
try {
sw.close();
pw.close();
} catch (IOException e) {
// ignore
}
}
}
return exceptionStack;
}
|