I'm also interested in any good ideas on this topic. I didn't spend enough time on this to know I had exhausted all possibilities. I just made my error page a very simple "An error occurred" statement so that it wouldn't look ugly when included as part of many tiles.

I figured that exceptions wouldn't happen too often at the JSP layer because it has no logic in it and since I log all these exceptions I can make sure they're fixed and the user will never see my error page anyways. However, it would be nice to get a better solution.

David

This is a continuation of a post I submitted yesterday as an "off topic"
subject entiled:

"[OT] web.xml <error-page> configuration problem" (Special thanks to David
Graham for his many replies):


Currently, this isn't showing up in the archives so I couldn't provide a
link. However, I feel this is no longer an "off topic", but rather a
Tiles/JSP topic. The issue I'm facing is how to forward to an error page
(JSP) when a runtime exception (e.g. NullPointerException) occurs within my
JSP Tile. Currently, I've added the following directive to each of my JSPs:


<%@ page errorPage="/jsp/error.jsp" %>

I'd prefer to only specify this information in one place, but I can't figure
out how to do that either. The "<error-page>" setting in the web.xml
doesn't appear to work for JSPs, just regular Java code inside the web
container. Now, when an exception occurs in a Tile JSP, my error screen is
displayed, but it's inserted into the page with all the other Tiles
displayed as well. This can look really ugly depending on which Tile the
exception occurs in. What I would I would prefer to do is automatically
forward to a brand new screen. David Graham gave me the idea of redirecting
to a Struts action:


<%@ page errorPage="/displaySystemError.do" %>

But this causes the following exception:

java.lang.IllegalStateException: Cannot forward a response that is already
committed

I think that makes since b/c of the other Tiles (JSP Servlets) that have
already been processed and committed HTML to the output writer.  So I'm
stumped at this point.  Please reply if anyone has any bright ideas.

Thanks,

JOHN


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


_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



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



Reply via email to