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

Custom 404 error page

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added the following lines in web.xml and there is a 404.html in my root directory. It didn't work. Can any friend help me with it? Thanks in advance.
<error-page>
<error-code>404</error-code>
<location>404.html</location>
</error-page>
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The URL must begin with a '/' -- and is relative to the root of the Web App (check out the web.xml schema to confirm)
so try this:
 
pam jiao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jessica Sant:
The URL must begin with a '/' -- and is relative to the root of the Web App (check out the web.xml schema to confirm)
so try this:


-----------------------------------
Thanks Jessica. I tried it and still didn't work. Any other suggestions?
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did you use the whole path? something like /webapps/text/404.html? but the path should be specific to your directory structure.
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a guess here: it may depend on which server you are using, but you may have to reload/restart the application to get the server to re-read the web.xml file.
 
pam jiao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Philip Shanks:
Just a guess here: it may depend on which server you are using, but you may have to reload/restart the application to get the server to re-read the web.xml file.


---------------------------------
Thanks you all. I'm using weblogic server. I did use the full path and restart the server after changing in web.xml. More ideas?
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It did not work...does that mean nothing gets displayed. make sure that the error is not being caught. Also assuming you are using IE, make sure the setting to suppress server generated error messages is not set.
 
pam jiao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bosun Bello:
It did not work...does that mean nothing gets displayed. make sure that the error is not being caught. Also assuming you are using IE, make sure the setting to suppress server generated error messages is not set.


------------------------------------
Thanks Bosun. I changed the setting and it's working now. Also thanks you all for your kind responses.
 
Is that a spider in your hair? Here, threaten it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic