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

problem while declaring error page

Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
i have jsp(result.jsp) page as shown below

errorPage.jsp is

My <error-page> tag in web-xml is-:

now problem is that if will remove errorPage directive from result.jsp
then ${pageContext.exception} in errorPage.jsp does not display anything.
why it is so?
Thanks
Krishna Srinivasan
Ranch Hand

Joined: Jul 28, 2003
Posts: 1844

Read This :
http://www.onjava.com/pub/a/onjava/2003/12/03/JSP2part2.html


Krishna Srinivasan
Spring Tutorials, OCAJP Mock Questions, 400+ OCPJP Mock Questions
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Are you sure ?
Removing that line should not prevent you from still displaying the error.
I removed the line <%@ page errorPage="erreur.jsp" %>
and reduced the JSP to this :

and I still can see the error details using the EL variable pageContext : ${pageContext.exception}


[ November 17, 2006: Message edited by: Max Fernandes ]
[ November 17, 2006: Message edited by: Max Fernandes ]

SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
no i my case it does not display contents of ${pageContext.exception} if i will remove errorPage directive.
i am using Tomcat5.0
Renu Radhika
Ranch Hand

Joined: Oct 21, 2005
Posts: 243
<@% page isErrorPage="true" %> the syntax is wrong it should be
<%@ page isErrorPage="true" %>

change this and try
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
i am using <%@ page isErrorPage="true" %> only.
Renu Radhika
Ranch Hand

Joined: Oct 21, 2005
Posts: 243
I think its because in the page directive you are not using /errorPage.jsp whereas you have specified that way in DD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem while declaring error page