Hi, Iam aware that u have to include the page directive in the page where the error is generated so that it is forwarded to a jsp error page which has the directive "isErrorPage="true"...but doesnt seem to be working... my html is in "c:\tomcat\webapps\app-name\subfolder" with the page directive before the <html> tag. <%@ page errorPage="/subfolder/show_error_page.jsp" %> my error page is in the same folder too named "show_error_page.jsp" with the foll code <html> <body> <%@ isErrorPage = "true" %> this is a custom error page <p><i> <%= exception %> </i> <body> </html> iam not sure where the mistake is...Greatly appreciate the help
Also read in one of the prevs messages that the page directive in the html page should be above the html tag...i tried it as the first line in body and before html too...confused as to what is right <%@ page errorPage="show_error_page.jsp" %> before html tag or first line of body tag??? sorry for the 2nd post
Hello Sangeetha, can you please tell, which exception gets generated in your main jsp page? Also if the control doesn't go to error page (when exception is generated), what is displayed? and lastly are you using try-catch in your main jsp?
Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Hi Prakash, actually iam the one inducing the error for testing purposes...iam not using try catch..iam just trying to write to a file and so for testing i made it read only....so that an exception is created and i can see my custom error page..its status 500 error type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception java.io.FileNotFoundException: C:\Tomcat 5.0\webapps\murach\WEB-INF\etc\UserEmail.txt (Access is denied) hope this helps
I was playing around with this earlier today, so some of the problems are fresh in my mind. First, make sure your current page works. Remove your errors and make sure there aren't other errors masking your error. Then put in your error--and make it simple, maybe an SQL error or something like that. For the error page reference, try both relative and absolute paths. Hope this helps.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop