I've been having trouble getting exceptions handled usefully when they occur within jsps called via tiles:insert tags.
I've tracked the code down to:
org.apache.struts.taglib.tiles.InsertTag
where this exception handling code is called:
protected void processException(Throwable ex, String msg) throws JspException {
try {
if (msg == null)
msg = ex.getMessage();
if (log.isDebugEnabled()) { // show full trace
log.debug(msg, ex);
pageContext.getOut().println(msg);
ex.printStackTrace(new PrintWriter(pageContext.getOut(), true));
} else { // show only message
pageContext.getOut().println(msg);
} // end if
} catch (IOException ioex) { // problems. Propagate original exception
pageContext.setAttribute(
ComponentConstants.EXCEPTION_KEY,
ex,
PageContext.REQUEST_SCOPE);
throw new JspException(msg);
}
}
my understanding of this code is that no exception will be passed to the enclosing jsp page. If an excption occurs, a simple error message will appear in the enclosing page. If debug is enabled for the Logger "org.apache.struts.taglib.tiles.InsertTag" then the stack is filled in too. Am I right?
If so, would it be better to enable excptions to be cascaded up, enabling exception management in a more application specific manner? e.g. making use of the error-page elements in the web.xml
I'd like to be able to log the error centrally and display to the user a meaningful error page.
thanks Nathan
p.s. thanks to all the development team. Struts seriously reduces devlopment time and increases the quality of applications built with it.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]