Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom 404 error page  RSS feed

 
pam jiao
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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>
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
Joe Broderick
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • 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.
 
Philip Shanks
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!