• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

error-page!!!

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have put the following lines in web.xml

<error-page>
<error-code>500</error-code>
<location>/logo.html</location>
</error-page>

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?

<error-page>
<exception-type>MyException</exception-type>
<location>/logo.html</location>
</error-page>
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
HelloWorld
.........../web-inf
...................../classes
..............................HelloWorld.class
...................../web.xml
.........../index.html
.........../temp
.................logo.html
[ July 16, 2004: Message edited by: kriti sharma ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic