This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JSP and the fly likes Not able to get the new page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Not able to get the new page" Watch "Not able to get the new page" New topic
Author

Not able to get the new page

Ravindranath Chowdary
Ranch Hand

Joined: Nov 08, 2006
Posts: 71
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

Joined: Nov 24, 2005
Posts: 14687
    
  16

Blank page ??
First, check Tomcat's log files to see if there's no exception raised.


[My Blog]
All roads lead to JavaRanch
Ravindranath Chowdary
Ranch Hand

Joined: Nov 08, 2006
Posts: 71
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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
Consider Paul's rocket mass heater.
 
subject: Not able to get the new page