struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@attws.com>
Subject RE: [Declarative Exception] How to access the exception text
Date Thu, 26 Dec 2002 17:01:35 GMT
The Exception object is just that, an object.  If you want to call methods on it to pull information
out of it, you can.  You can call the "printStackTrace()" method to store the stack trace
on a stream or writer (like a "StringWriter").

> -----Original Message-----
> From: Jerry Jalenak [mailto:Jerry.Jalenak@LABONE.com]
> 
> David - thanks for the reply.  Using the 'o.a.s.a.EXCEPTION' in a
> <bean:write> gives me the basic exception (i.e.
> java.lang.NullPointerException). It would be nice to be able 
> to provide
> additional information - stack trace or something similar.  
> Do I need to
> write a custom ExceptionHandler to do this?
> 
> Jerry
> 
> > -----Original Message-----
> > From: Karr, David [mailto:david.karr@attws.com]
> > 
> > Unfortunately, the only thing that is really clear about this 
> > is the code (AFAICS).  The default exception handler will put 
> > the exception into request scope under the key symbol 
> > "Globals.EXCEPTION_KEY", which is the string 
> > "org.apache.struts.action.EXCEPTION".
> > 
> > > -----Original Message-----
> > > From: Jerry Jalenak [mailto:Jerry.Jalenak@LABONE.com]
> > > 
> > > In my struts-config I have a <global-exception> defined to handle
> > > java.lang.Exception:
> > > 
> > > 	<global-exceptions>
> > > 		<exception path="error.page" 
> > > type="java.lang.Exception"/>
> > > 	</global-exceptions>
> > > 
> > > On this page I want to be able to display the text from the 
> > > exception (i.e.
> > > e.getMessage()).  How can I get access to this?

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message