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: 1518
    
    6
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: 1518
    
    6
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: 63355
    
  70

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp defined in error-page is not displayed
 
It's not a secret anymore!