Erik, David, and Mike - 

Thanks for the replies - interesting to note that all three of you suggested
basically the same answer, that of using the exception mechanism.  When
implementing this, do you code individual, specific exception handlers (i.e.
InvalidUserException, etc), or do you have a generic handler that you can
pass a 'cause' back through?

Thanks.

Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]


-----Original Message-----
From: Mike Jasnowski [mailto:[EMAIL PROTECTED]
Sent: Friday, August 08, 2003 2:29 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: [OT - Slightly] Returning Error Status from Business Layer


You should look also at the declarative exception handling Struts has. 

-----Original Message-----
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Friday, August 08, 2003 3:26 PM
To: Struts Users Mailing List
Subject: Re: [OT - Slightly] Returning Error Status from Business Layer


--- Erik Price <[EMAIL PROTECTED]> wrote:
> 
> 
> Jerry Jalenak wrote:
> 
> > Just curious - how do most of you return errors from your business
> model?
> > Do you simply return an integer value (-1, 0. 99?) and then interpret
> it in
> > the action?  

Yuck.

> >Or do you return a error string that maps to something in
> > ApplicationResources?  Any other techniques?  I'm trying to find a
> 'best
> > practice' on how to do this....  
> 
> Java has a really elegant mechanism for returning errors called 
> Exceptions....

Errors from the business layer should be reported as exceptions.  The
exception could carry a list of error messages or resource keys so that
the next layer can display a message to the user.  Or the next layer could
interpret the exception into some error message, it's your choice.

David

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


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



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


This transmission (and any information attached to it) may be confidential and is 
intended solely for the use of the individual or entity to which it is addressed. If 
you are not the intended recipient or the person responsible for delivering the 
transmission to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, printing, or 
copying of this information is strictly prohibited. If you have received this 
transmission in error, please immediately notify LabOne at the following email 
address: [EMAIL PROTECTED]



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

Reply via email to