wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes error page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "error page" Watch "error page" New topic
Author

error page

Adolfo Eloy
Ranch Hand

Joined: Mar 21, 2009
Posts: 146

Hi all.

I'm studying the topic about creating my own error pages and how to recover from that.
I've created a small test that is made of 2 JSPs. The first JSP (Result.jsp) is a page that use a custom EL that can generate a java.lang.ArithmeticException.
The second JSP is the errorPage (error.jsp).

When I declare my error-page like the code that follows, the stack trace is presented to the browser instead of my error page.



But when I declare my error page at DD like the code below it works perfectly:


Indeed, the java.lang.ArithmeticException occurs at the class that implements my custom EL.
So, that's my doubt: I'd like to know, if there is any way to map an Exception that may occur bottom at the exception stack.

thanks

Adolfo Eloy
Software Developer
OCPJP 6
Niiraj Patel
Ranch Hand

Joined: Sep 17, 2011
Posts: 47
Hi Adolfo,

Nice experiment ..!!

There is no way out to map your actual Exception to your ELException.

Resoan is, Normally EL expression methods in API throw javax.el.ELException which is RuntimeException.

Thanks,
Niraj
Stoian Azarov
Ranch Hand

Joined: Jun 01, 2011
Posts: 113
Hi Adolfo,
Can you provide the EL expression that throws javax.el.ELException. I have been trying to simulate your example but without any success. My error page is working even if I define it in DD with java.lang.ArithmeticException.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error page
 
Similar Threads
JSF : redirect errors to error page
JSP and custom Exception class
configuring error pages in DD
How to catch errors inJSP
response.sendError & error-page