Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem While Running Jsp Error Page.

 
Prasad Pusapati
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I Have Follwoing Problem.I Wrote 2 JSP Pages Named ABC.jsp & CBA.jsp Running In Tomcat5.5.While Making Request TO ABC.jsp I Am Getting Following Error.Please Help Me To Resolve This.
__________________________________________________________
ABC.jsp
<%@ page errorPage="CBA.jsp" %>
<html><body>
<% if(true){
throw new Exception("Exception Thrown By ABC.jsp");

}%>

</body></html>
______________________________________________________________


CBA.jsp
<%@ page isErrorPage="true" %>
<html><body>
Error Is:<%= exception.getMessage() %>
</body></html>
_______________________________________________________________

ABC.jsp & CBA.jsp are In Tomcat5.5/webapps/myapp/
1)Why Internal 500 Error Is Comming While Making A Request To ABC.JSP
I Am Making Request Like This: http://localhost:8080/myapp/ABC.jsp
2)How Can We Do Debugging In Tomcat5.5?.
3)Does Tomcat5.5 Supports Auto Reloading Of Servlet After Making Any Changes To It?.
Please Help Me For Solving Above Problem(s)?.
Thanks In Advance,
Prasad p.
 
Naresh Arige
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you use the throw, I think the rule says, either you must be caught the exception or declared to be thrown (if its a method). Thats the reason, you must be getting the INTERNAL Server error. To make sure rewrite the code in java and try to compile and you will get the same error.

To test the @errorpage logic, you may replace the if(true)... with
int foo = 10 /0; without throwing any exception.
 
Prasad Pusapati
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Naresh,
I Am Getting Same Error. HTTP 500 - Internal server error
I Added Code In Scriplet: int i=100/0; Instead Of throwing Exception;
Please Help Me To Solve This Problem.
Thanks,
Prasad Pusapati.
 
Sree Nivas
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it should be problem with name of the file. The name of the filename is case sensitive.

http://localhost:8080/myapp/ABC.jsp must match exactly ABC.jsp
and
<%@ page errorPage="CBA.jsp" %> must match exactly CBA.jsp.

It was working fine in my machine with tomcat 5.5. No issues.

regards
Sreenivas
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic