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]