Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Problem While Running Jsp Error Page.

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic