This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Servlet Error Code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Error Code" Watch "Servlet Error Code" New topic
Author

Servlet Error Code

vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 219
Hi Everyone,

I am developing a project on servlets. I want to define my custom exceptions in web.xml file. i developed my own custom exception class.
In the servlet program i threw the exception. so that my container need to check the exception object in web.xml file and move to corresponding page as configured.

I am unable to get the error page i have configured...

Unable to get the mistake what i have done.so i am posting the code here..If anyone could please help in solving this.


web.xml




my customexception class


RaiseException code



Thanks
Vipul Kumar
Miku Ranjan
Ranch Hand

Joined: Oct 11, 2011
Posts: 98
Hi,
Please check the link below may be useful to you.
http://www.jguru.com/faq/view.jsp?EID=1347
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Is there any exception? or nothing happens?

I this psot I show how to Handling Exceptions on a WebApp.

I hope it helps you.


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1051
    
    5

Hi

On line 9 of RaiseException, a java.lang.ArithmeticException will be thrown. Has this been left in by accident?

I think more information on what the output of invoking the servlet is would be helpful.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Servlet Error Code
 
It's not a secret anymore!