You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by GnomeKing <gn...@gmail.com> on 2005/07/03 00:43:10 UTC

Beans throwing exceptions

I have a bean which occasionally throws an exception

This exception is caught in TagUtils.java:962 (struts-1.2.7), saved
(967) and then a completely new JspException thrown (968).  I'm
assuming this is what is happening, but I don't have a stack trace to
indicate it - but that is the only location the exception message is
referenced.

This exception is then caught on line 894, and saved, and then rethrown...

The problem is that the saving the exception only seems to support one
exception at a time?

How can I access the real exception from my error JSP, rather than the
fresh JspException thrown by Struts?

Thanks for the help,

Bob

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


Re: Beans throwing exceptions

Posted by GnomeKing <gn...@gmail.com>.
On 02/07/05, GnomeKing <gn...@gmail.com> wrote:
> I have a bean which occasionally throws an exception
> 
> My exception is caught in TagUtils.java:962 (struts-1.2.7), saved
> (967) and then a completely new JspException thrown (968).
> This exception is then caught on line 894, and saved, and then rethrown...

If it is not possible to get the exception because struts hides it, is
it possible to save the exception myself?

Can I catch the exception in my bean and save it somewhere (then
re-throw it to ensure we go to an error page)?
Because its in a getter/setter for a bean, I can't see how to get the
context - but can I retrieve the context from static methods? or some
other way?

Is the above error considered a bug in Struts? because if it is, I'm
more than happy to report it (I guess if it is a bug, the new
JspException should just wrap the caught exception?)

Thanks in advance for any suggestions,

Bob

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