Welll,
  The way I've done this before is to wrap all Exceptions in a Custom type
and throw it all the way back to struts.  This seems to work well for
trivial business style apps, I'm not sure how it would hold up in something
with more complexity in the business layer.  For example, My CRUD code would
catch SQL exceptions, check out what the real problem is, and, if it is a
genuine problem, throw a new FrameWorkException with the proper error
message (or message key) contained in it.  

  I would also be curious on how other folks do such things however...


worse is better 

-----Original Message-----
From: Baljinder Singh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 25, 2003 9:55 AM
To: Struts Users Mailing List
Subject: Struts Exception Handling


Hi All,

I am looking for a robust exception handling approach in struts. Can
somebody help me in that. My framework consists of struts interacting with
session beans which then interact with DB through DAO. Now if during a CRUD
operation, for example there is a duplicate key exception thrown, how should
I handle it so that I can show the user exact message that duplicate key is
being inserted. Same for all kind of database messages and validations.

Thanks & Regards,
BS


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-----------------------------------------
This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to