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

error page in web.xml

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to get all the errors or exceptions happening in my application. So, i configured my web.xml like this

<error-page>
<location>/test/error.jsp</location>
</error-page>

I didn't add <error-code>, <exception-type>. So, i feel that all the errors or exceptions happening in my application will redirect to error.jsp.
But this is not working.

Please guide me how to proceed.

or is there is any way to get all the error codes by mentioning <error-code>/*</error-code>?

Please advice me.

But same thing if <error-code> or <exception-type> include means it is working fine.

Thanks
Ravi

[ September 18, 2008: Message edited by: RaviKumar AK ]
[ September 18, 2008: Message edited by: RaviKumar AK ]
 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I didn't add <error-code>, <exception-type>. So, i feel that all the errors or exceptions happening in my application will redirect to error.jsp.
But this is not working.


<error-code> and <exception-type> both are optional but you need to provide atleast one of them. As per DTD of web.xml

<!ELEMENT error-page ((error-code | exception-type), location)>
[ September 18, 2008: Message edited by: Satya Maheshwari ]
 
Ravi Kumar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Is there any way to get all the error codes at one time in web.xml?

If not, please let me know how to get all the error codes through servlet/jsp. So that i can handle in my code.

Thanks for suggestion.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"RaviKumar AK ", please check your private messages for an important administrative matter.
 
Ravi Kumar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I given my login name as display name. Now i changed the publically displayed name.

Thanks for suggestion.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"RaviKumar", My request that you change your display name to adhere to JavaRanch standards was not a suggestion. Valid display names are mandatory for participation on the Ranch. Please change your display name as instructed prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Be aware that accounts with invalid display names are disabled.

bear
JavaRanch Sheriff
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by RaviKumar AK:
Hi,

Is there any way to get all the error codes at one time in web.xml?

If not, please let me know how to get all the error codes through servlet/jsp. So that i can handle in my code.

Thanks for suggestion.



You can give an 'error page directive' in your jsp to show a fixed page in case of any error.
 
Ravi Kumar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear,

Changed the display name. Thanks for alerting me to change the display name.
 
reply
    Bookmark Topic Watch Topic
  • New Topic