I started out using the JSP errorPage directive. Then I realized
I wanted to handle errors from my Action classes and my JSP's on the
same page, so I had my jsp error page forward to another page that
actually handled the errors. The actions forwarded directly to the
error-handling page.
This worked great until I started jsp:include'ing other pages. Once you
do a jsp:include, you can't forward to the error page. So I quit using
errorPage. Instead, I start every page with a try block, and end every
page with a catch block. The catch block is pretty much my original
error-handling page - it logs the exception and displays a message to
the user.
The try and catch declarations are in separate files that are
@include'ed (NOT jsp:include'ed!) so the syntactic burden on the jsp
writer is minimal.
I'd love to hear about other error-handling archtectures.
"Charlemagne L. Rey" wrote:
> hello everyone,
>
> i studied the struts example and tried to create my
> own application. now, i would like to have my errors
> or a separate page. do you have idea how i would deal
> with it? something like a separate error page...
> what are the neccessary things i need to do?
>
> cheers!
> charlemagne