aspose file tools*
The moose likes JSP and the fly likes error page in web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "error page in web.xml" Watch "error page in web.xml" New topic
Author

error page in web.xml

Ravi Kumar
Greenhorn

Joined: Aug 28, 2008
Posts: 18
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 ]
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
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 ]

Thanks and Regards
Ravi Kumar
Greenhorn

Joined: Aug 28, 2008
Posts: 18
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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

"RaviKumar AK ", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ravi Kumar
Greenhorn

Joined: Aug 28, 2008
Posts: 18
Hi,

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

Thanks for suggestion.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

"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

Joined: Jan 01, 2007
Posts: 368
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

Joined: Aug 28, 2008
Posts: 18
Hi Bear,

Changed the display name. Thanks for alerting me to change the display name.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error page in web.xml