This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

badPage.jsp - HFSJ pg 458

 
Mukunthan Shanmuganathan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Guys!

In order to check the Error Page I tried the example given in the HFSJ pg. 458. Without an error in the badPage.jsp and errorPage.jsp are working fine.

But, When I put <% int x = 10/0; %> and run, I get the "The Page Cannot be displayed - HTTP 500 internal Server Error" instead of my own errorPage.jsp.

Why? and How can I get the errorPage.jsp displayed?

Thank you.



:roll:
 
Tarun Yadav
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you set <%@ page errorPage="errorPage.jsp" %> ?
 
Mukunthan Shanmuganathan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Tarun Yadav,

Yes I did.

for your convenience I put my code here!

-------------------------------------------

<%@ page errorPage="errorPage.jsp"%>
<html><body>
About to be bad...
<% int x = 10/0; %>
</body></html>

-------------------------------------------

<%@ page isErrorPage="true"%>

<html><body>
<strong>Bummer</strong>
</body></html>

Thank You!
 
Mukunthan Shanmuganathan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys!

Can any body sort this out? Please

Thank You!

 
Tarun Yadav
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code is absolutely fine. There must be something else that's wrong. Can you post the complete stack trace please?

Also, make sure it's not this cause: http://faq.javaranch.com/java/ErrorPageInIe
 
Mukunthan Shanmuganathan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Tarun Yadav,

You are right.

I had to Turn off the friendly error message option in the browser.

It is working.

Thank you!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic