Hello all,

I'd like to handle any and all exceptions handled thrown by my JSP pages declaratively, ideally using <global-exceptions> in struts-config. Currently, I have a JSP page called by a tile that uses the JSTL Tag Library. Using the c tag I perform a check like this:

<c:if test="${!empty featuredProductView.title}">
... do some work ...
</c:if>

If the method getTitle() throws an exception, I currently see the following on the screen:

-- snip --
javax.servlet.ServletException: javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "test" with value "${!empty featuredProductView.title}": An error occurred while getting property "title" from an instance of class com.mandaladesigns.apps.commerce.framework.view.FeaturedProductView (com.mandaladesigns.common.exceptions.MandalaException)
-- snip --


This also appears in the tomcat localhost log along with the stack trace. But what's really interesting to me is the data I placed in com.mandaladesigns.common.exceptions.MandalaException, which is my own exception type that subclasses RuntimeException. Though explicitly using an errorPage directive in the page works, I'd like to avoid having to place an errorPage directive in all of my JSP files.

So, is there a way that I can place a directive, either in web.xml or struts-config.xml that will handle these exceptions? It seems that using <error-page> in web.xml and <global-exception> in struts-config.xml directives are not consulted for this situation. I've created entries for every type of exception that seems relevant in both places but they don't seem to be getting called.

Thanks for your help,

Jonathan.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to