GeeCON Prague 2014*
The moose likes JSP and the fly likes Jsp defined in error-page is not displayed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp defined in error-page is not displayed" Watch "Jsp defined in error-page is not displayed" New topic
Author

Jsp defined in error-page is not displayed

netto gaurav
Greenhorn

Joined: Jan 29, 2008
Posts: 7
Hi,
I'm trying to run a simple scenario...I have a jsp (index.jsp) in the and i'm throwing an exception and ArithmeticException(divide b zero) using scriplet from this jsp. In the error page tag of the web.xml I have defined a page first.jsp to be displayed on an ArithmeticException. But, for some reason it ain't working. I have maked the first.jsp as an error page using isErrorPage...

Please guide as to what I could be doing wrong...


my web,.xml

index.jsp -


first.jsp


Thanks
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

in both of your jsp %> is commented .. hence you get some error. by the way: what is your error message in browser when you run
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
This is the functionality I have observed running against Tomcat 7:

- Use the JSP as above
- Result: 500 error - error in log
- Remove the division by zero
- Result: succeeds - no exception is thrown
- Put the division by zero back
- Result - custom error message displayed

Obviously having a page that has successfully compiled/run at some point in time makes a difference.

Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
Oh, and to print the stack trace to your JSP page (which you look like you were trying to do), use the following

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61317
    
  66

It is never appropriate to display a stack trace to the end user.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Don't get me started about those stupid light bulbs.
 
subject: Jsp defined in error-page is not displayed