• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

"Page not found" exception  RSS feed

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my web application I would like to customize ""Page not found" exception to my user defined exception message.
so when ever user request to a given page , which does not exist should should my user defined exception

How could i do this?

Thanks,
aakash
 
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your web application's web.xml needs to have the following entry.
<error-page>
<error-code>404</error-code>
<location> your_custom_error.page</location>
</error-page>

hth,
Sudharsan
[ August 23, 2004: Message edited by: Sudharsan G'rajan ]
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing to keep in mind. The error page you specify must be at least 512 bytes or IE will revert to the IE file not found error page (not the customized page).

For more info:
http://www.404-error-page.com/404-error-page-too-short-problem-microsoft-ie.shtml

Good Luck!
[ August 25, 2004: Message edited by: Mike Berna ]
 
Author and ninkuma
Marshal
Posts: 66826
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, been burned by that one. Doncha just love IE?

<hack-alert>
If all else fails, put a large HTML comment in your page to force it over the limit.
</hack-alert>
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!