File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Cannot get to the error page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Cannot get to the error page" Watch "Cannot get to the error page" New topic
Author

Cannot get to the error page

John Dell'Oso
Ranch Hand

Joined: Apr 08, 2004
Posts: 130
Howdy there,

I've recently installed Tomcat 5.0.25. I am having problems directing a jsp page to an error page. This worked fine with Tomcat 4.0. I end up getting an HTTP 500 Internal Server error. Here's the code:

### File - errorTesting.jsp

<%@ page errorPage="errPage.jsp" %>
<html>
<head>
<title>Simple Error Testing</title>
</head>

<body>
<%! String nullString = null; %>

<%-- Intentionally invoking a NullPointerException --%>
The length of the nullString is <%= nullString.length() %>
</body>
</html>

##### File - errPage.jsp

<%@ page isErrorPage="true" %>

<h2>Uncaught exception <%= exception %> has been encountered!</h2>

----------------------------------------------------------------------

As you can see there is no rocket science here. But I cannot get the error page to show. I just keep getting the IE "This page cannot be displayed" message. If I change the value of the nullString variable to an actual string value, the JSP page works fine. As soon as I change it back to null in an attempt to throw an exception and forward through to the error page it all blows up.

Both JSPs are in the same directory. I have checked the work directory under Tomcat and the java code looks fine and the .class file is created as well.

Any ideas as to what is going on here? As I mentioned earlier on my post, this code works on another machine where I'm running Tomcat 4.1.18.

Cheers.
[ July 15, 2004: Message edited by: Wayne Carey ]
John Dell'Oso
Ranch Hand

Joined: Apr 08, 2004
Posts: 130
Well here's the answer .. seems to be a typical Microsoft thing with IE. The work around (fix) to this problem is to turn off the "Show friendly HTTP error messages" option in IE. Navigate to Tools -> Internet Options -> Advanced -> Browsing.

Cheers,
The Duck
Pedro Penna
Ranch Hand

Joined: Jun 05, 2004
Posts: 46
Try changing the errorPage path to /errPage.jsp, like this:

[ July 16, 2004: Message edited by: Pedro Penna ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot get to the error page
 
Similar Threads
getAssociatedStylesheets failed
Error while exporting to PDF using Jasper Report
JSTL issue in Tomcat
jsp:useBean error in WebSphere
datasource???