Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able to get the new page

 
Ravindranath Chowdary
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I want to make use of isErrorPage and errorPage attributes of Page directive in JSP. For that I wrote the following lines of code. But, couldn't able to get the page what I needed. Please, look at the following lines of code and clear my doubt.

In web.xml I added the following lines of code for the error page:-
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>


In the jsp for which error page is needed i mentioned as following in page directive..

<%@ page errorPage="/error.jsp"%>

In the error.jsp:-
<%@ page isErrorPage="true" %>
<html>
<head>
<title>Error Page</title>
</head>
<body>
<h2>Your application has generated an error</h2>
<h3>Please notify your help desk.</h3>
<b>Exception:</b><br>
<%= exception.toString() %>
</body>
</html>


After starting the TOMCAT, I just gave some invalid url. It is showing an blank page. How can i get back from this issue?

Thanks,
Ravindranath.
[ November 19, 2006: Message edited by: Bear Bibeault ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Blank page ??
First, check Tomcat's log files to see if there's no exception raised.
 
Ravindranath Chowdary
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have checked the log file in Tomcat, there no errors raised. Even if I give the invalid url, I am staying in the same page (i.e, the page from which i typed the url).

Thanks,
Ravindranath.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also try using your browser's "View Source" feature to see if the page really is blank or if there is just an error in you HTML that is keeping the page from rendering.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic