aspose file tools*
The moose likes Servlets and the fly likes Designing Exceptions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Designing Exceptions?" Watch "Designing Exceptions?" New topic
Author

Designing Exceptions?

Jignesh Gohel
Ranch Hand

Joined: Dec 28, 2004
Posts: 276
Hi,

I have a made a application using MVC architecture havinfg servlets & jsp.Till now i was debugging my application's error using LOGGER .But i want to design some standard jsp exception pages which can inform the user about the problem either technical related or business logic related

So i want to make some general classes for the exceptions so that i can redirect the messages to that general classes for whatsoever the exception is about.
So can anybody give me some guidance regarding this ???

Thanks,
Jignesh
[ March 19, 2006: Message edited by: Bear Bibeault ]

Regards,
Jignesh

The Art Of Life Is To Know When To Be Useless And When To Be Useful - CHUANG TZU
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Designing with Exceptions : When and How to Use Exceptions

Handling Unhandled Exceptions in a JSP Page


My blood is tested +ve for Java.
Jignesh Gohel
Ranch Hand

Joined: Dec 28, 2004
Posts: 276
Hi i have designed one exception class.
What the process follows is:

I am clicking a button from my welcome.jsp page to get connection to the database which hits my makeConnection servlet.The makeConnection servlet calls getConnection() method of some another class .In that other class i m forcefully making runtime error so that i can display my jsp error page.But i am getting the conventional jsp error page provide by Tomcat .

I have include an error-page tag in the web.xml correctly.Also i have defined the jsp page with errorPage attribute = "true".

So how to make my error page display if the exception is generated when my servlet takes use of some model class which(the model class) generates the exception???

Thanks,
Jignesh
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026

I have include an error-page tag in the web.xml correctly.Also i have defined the jsp page with errorPage attribute = "true".


Did you match the correct exception in web.xml.
Are you catching your exception in model(or)servlet class?
Do you posting your error tags here.


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
 
jQuery in Action, 2nd edition
 
subject: Designing Exceptions?