This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

"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 ]
 
Marshal
Posts: 67226
169
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>
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!