This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes error-page!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "error-page!!!" Watch "error-page!!!" New topic


kriti sharma
Ranch Hand

Joined: Feb 16, 2001
Posts: 160
i have put the following lines in web.xml


and called response.sendError(500);

but the page is not found by the server.what is the mistake?

if i make my own exception classes extending ServletException, for my web app will this work?

Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
first question: where did you put the logo.html? The given URI is relative to the webserver root, not the web application root!

second question: no. The codes are for standard HTTP error codes, not Java exceptions.

kriti sharma
Ranch Hand

Joined: Feb 16, 2001
Posts: 160
NO: the URI is wrt to the web app root!!i am working on weblogic i which there is only one root and that is your web-app root.the concept of web-server root is with tomcat where you have to put your web-app folder in parallel to the web-server ROOT directory which is the defalut web-app.

my directory structure:
[ July 16, 2004: Message edited by: kriti sharma ]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60733

I don't see the probem. The URL you specify for the error page should be context-relative, so you should be ok there. I'm not sure what else the problem might be. What error message are you seeing?

And yes, you can declare error handlers for your own exceptions. For example:

Be sure to use the full classname for the exception class.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: error-page!!!
Similar Threads
Exception Handling
Error Page Problem
error-page element in web.xml
web.xml and error-page