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

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 i am posting the code here..If anyone could please help in solving this.


my customexception class

RaiseException code

Vipul Kumar
Miku Ranjan
Ranch Hand

Joined: Oct 11, 2011
Posts: 98
Please check the link below may be useful to you.
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.

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

Joined: Nov 09, 2011
Posts: 1051


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:
subject: Servlet Error Code
It's not a secret anymore!