This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

"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: 66784
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>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!