Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

expection object in JSP  RSS feed

 
MONZY THARIAN
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
when i am calling the error.jsp page i am not able get the implicit exception object.
any reason why ?
when i am executing the below code using response.sendRederect(error.jsp)
it is giving me null pointer exception.

/*
Error.jsp
==========
<%@ page language="java" isErrorPage="true" %>
<body >
<head><title>ASN Error</title> </head>
<font color= red size=5><center><b>There are problems in the Excution.Pls contact the administrator.
<H2>Error Message Page</H2>
<P>The Error: <%= exception.getMessage() %>
</P>
<br>
<a href="http://localhost:50100/srmsus/application/start.jsp" target="_top"><font color="#800080" size=4><b>Home</b></font></a></center>
</body>
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..
Why are you using sendRedirect..???
In order to use it, from the page from where you want to call error page, you need to do the following :

This will call the error page.
hth
MB
[ November 06, 2003: Message edited by: Malhar Barai ]
 
MONZY THARIAN
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi malhar ,
without send.Redirect(....) the error.jsp file is not invoked.
<%@ page errorPage="error.jsp" %> statment does not invoke error.jsp
any other reason
Monzy
 
Malhar Barai
Author
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi malhar ,
without send.Redirect(....) the error.jsp file is not invoked.
<%@ page errorPage="error.jsp" %> statment does not invoke error.jsp
Monzy


<%@ page errorPage="Error.jsp" %>
does that both reside in the same context.
hth
MB
 
MONZY THARIAN
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do u find out if it is in the same context or not.
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Monzy,
Malhar means do they both exists in same directroy
i.e if ur main jsp is in context tomcat4.1/webapps/examples/jsp
then dose ur errorPage.jsp also reside in same context?
also make sure ur errorpage.jsp has this line

<%@page isErrorPage="true" %>

cheers
Praful
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!