You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Raghu Kanchustambham <kr...@gmail.com> on 2006/01/28 05:36:04 UTC

Exception Handling in struts - Sitemesh messes it up! :(

Hi,
Before I introduced Sitemesh into my ecosystem, I used to handle
exceptions in a "declarative" fashion in the struts-config.xml.

For example,  an entry in struts-config.xml like:
<exception type="org.hibernate.exception.GenericJDBCException"
key="exceptions.database" path="/Exceptions.jsp"/>

would handle a good subset of my Database exceptions.



Now comes sitemesh, which is really a "servlet-filter". So what I see
happening is that this exception gets "wrapped" into a
JasperException. When my database is down, it no longer directs me to
/Exceptions.jsp page as it used to do before I introduced Sitemesh.

One of two things could be happening:
1. Sitemesh "hijacks" exception handling mechanism from struts framework
2. Struts can not handle it because it is now "wrapped" as a different
exception.

In case 1, I do not know how to get sitemesh let struts handle the exceptions.

In case 2, I wish I could declare in my struts-config, redirection to
error pages based on not just the type of the exception, but also the
type of exceptions "inside" the "container" exception. That way I can
get into the "exception trace" and redirect based on what is "inside"
the exception and not just the type of the superficial top-most
exception. Is this possible?

Can someone throw some light on this issue? I would hate to let go
"declarative" style of handling exceptions but introducing sitemesh
messed it all up! :(

Thanks.
Regards,
Raghu

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