Forums Register Login

<error-page> tag mechanism

+Pie Number of slices to send: Send
I put this tag in web.xml:


but when the error occurs my browser doesn't show errormessage.jsp! instead I see this message:

The website cannot display the page
HTTP 500
+Pie Number of slices to send: Send
As this is not Tomcat-specific, it's been moved to the Servlets forum.
+Pie Number of slices to send: Send
what is present inside errormessage.jsp ??

+Pie Number of slices to send: Send
 

Ravi Kiran Va wrote:what is present inside errormessage.jsp ??



<%@ page isErrorPage="true"%>
<html>
<head></head>
<body>
An error has occurred.
</body>
</html>
+Pie Number of slices to send: Send
Try to use <error-code>.
+Pie Number of slices to send: Send
Two things!

1. Have you tried putting this code in your jsp throwing any subclass of Throwable?


2. Have you checked if the page not displayed due to some kind of Error which is not a sub-class of Throwable?

Try to use <error-code>.


You don't need to necessarily use errorcode, errorpage should work.

Cheers,
Naren
---------------------------------
SCJP
SCDJWS
SCWCD
+Pie Number of slices to send: Send
The Error is a sub-class of Throwable. I don't want to use because my project is JSF based on Facelets.

Naren Chivukula wrote:Two things!

1. Have you tried putting this code in your jsp throwing any subclass of Throwable?


2. Have you checked if the page not displayed due to some kind of Error which is not a sub-class of Throwable?

Try to use <error-code>.


You don't need to necessarily use errorcode, errorpage should work.

Cheers,
Naren
---------------------------------
SCJP
SCDJWS
SCWCD

 
+Pie Number of slices to send: Send
I think, we should specify 3 things.

1) In web.xml, the DD
2) isErrorPage attribute of page directive of the error jsp/html.
3) setting the errorPage attribute of the page directive of the jsp with corresponding error page.
Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1105 times.
Similar Threads
Error Page Problem
Exception redirect to page
How to handle JSP exceptions declaratively
Error Page
welcome-file-list
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:33:54.