Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error-page ERROR

 
Rollyn
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please help. I have this pages. I'm using tomcat 5 and when i load page.jsp, it gives me
a server error 500, i tried also doing the error-code of 500, but it still doesn't work.
what wrong?

Page.jsp

<HTML>
<BODY>
<%
int x=10/0;
%>
</BODY>
</HTML>

Error.htm

<HTML>
<BODY>
DIVIDE BY ZERO ERROR
</BODY>
</HTML>

DD

<?xml version="1.0" encoding="iso-8859-1"?>


<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 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">


<error-page>
<exception-type>java.lang.ArithmeticException</exception-type>
<location>/Error.htm</location>
</error-page>

</web-app>
 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you made sure that Error.htm is actually places at the correct location (under context root, according to your dd)?
 
Rollyn
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

yes, i already done that too and still it doesn't work.
can you give me any information how to set it up? the procedure?
 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no special procedure for this.
I suggest you to remove the script from Page.jsp and try to access it. Check out if you're able to access the jsp. Actually, just remove the part the gives the exception, replace it for 10/2 instead of 10/0.
 
Amit Saini
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dude, I just tried out your exact code. It works fine.
I placed both the files right under the application root
ie. tomcat\webapps\app\file1 and tomcat\webapps\app\file2
 
Rollyn
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i saw this suggestion from one of the member.
<i>
Basically I'm guessing your using IE, which has like a "use friendly error pages" setting. If that switch is flicked, you wont see the custom error page.

David Abramowicz
</i>

i tried it and it worked. (Internet Option, Advanced, show friendly HTTP error messages), so what happened if the client doesn't know this option?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic