Hi all,
I am trying to configure an errorPage, but it's not working...
below is code for my web.xml, errorPage.jsp.
--------------------------------------------------------------------
web.xml
<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<description>
JSP 2.0 Examples.
</description>
<display-name>JSP 2.0 Examples</display-name>
<error-page>
<exception-type>java.lang.throwable</exception-type>
<location>/errorPage.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/errorPage.jsp</location>
</error-page>
</web-app>
------------------------------------------------------------
errorPage.jsp
<%@ page isErrorPage="true" %>
<html><body>
<h1> Sorry!! There is a problem... </h1>
</body></html>
-----------------------------------
now, I tried it with a simple jsp, below is the code for that
badPage.jsp
------------------------------------
<html<body>
<H1> Hello!!! <br> Welcome to my Page </h1>
<BR><A Href="Each.jsp" >Each</A>
</body></html>
------------------------------------------
The link Each refers to a page that doesnot exist, so after clicking on the link, the error page should appear... but problem is that, it is showing the usual "The page cannot be found" page....
I added <%@ page errorPage="errorPage.jsp" %> in the badPage.jsp, but even that is not working...
I would really appriciate any help...
Regards,
Sushma