struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Germuska <...@Germuska.com>
Subject Re: Tiles is hiding my jsp error messages?!
Date Tue, 01 Feb 2005 14:08:29 GMT
>Can't answer that for you.  I've used Tiles many times on various 
>project, but I am certainly no expert on it.  In my experience with 
>it, I turn to the logs for help when I have these kinds of errors.
>
>Or, if that doesn't help, step 2 (for me) is to remove the entire 
>contents of that particular tile, and slowly replace it piece by 
>piece until it stops rendering, then examine the part you just put 
>back.  I know that sounds crazy, but it works for me.....and it 
>almost always ends with "(head smack)...what was I thinking?".

It's not really Tiles' fault; remember that those errors are being 
thrown essentially by JSP include operations, at which time there's 
no ability to redirect to an error page (because the response is 
already committed.)  What would you have Tiles do?  Dump the error to 
the page?  That may work for some users, but not all, and not all 
errors can be handled that way anyway.

So far, the best results I've had for something like this is with the 
JSTL core <c:catch> tag, and a homegrown tag I have which takes an 
Exception class and can be configured to show or not show the 
exception's message and which can be configured to dump the 
root-cause stack trace, optionally (usually) enclosed in HTML 
comments.

With the chain based request processor, the exception propagates all 
the way to the configured ExceptionHandler, but the base 
implementation of that class expects to be able to forward to an 
error page; perhaps a variant could be written which tests to see if 
the response is committed and takes a different route.  I've 
experimented with some things around that, but haven't found anything 
I was so excited about yet.

I definitely agree that troubleshooting runtime exceptions from JSPs 
is frustrating, which to me is just another reason to design your app 
so that everything except the most basic happens before control is 
dispatched to the view.

Joe

-- 
Joe Germuska            
Joe@Germuska.com  
http://blog.germuska.com    
"Narrow minds are weapons made for mass destruction"  -The Ex

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


Mime
View raw message