Re: how to return errors from Model component

2002-09-06 Thread Ted Husted
A typical approach is to pass a DataSource up to the model (hence the DataSource manager). The model then just uses whatever DataSource it is given to snag a connection. I recently came up with a ConnectionAdaptor that can be used by the model directly. The servlet instantiates the adaptor an

RE: how to return errors from Model component

2002-09-06 Thread Jason Rosen
List' Subject: RE: how to return errors from Model component Hi Donald, The approach I have used is to define a base exception that contains a map of error messages. Have your business exceptions extend this. In the struts action class catch the exception and morph them into ActionErrors,

RE: how to return errors from Model component

2002-09-06 Thread Kenny Smith
Hi, > Someone on the list once said that the Model should > not know its in a web app... I totally agree with this statement, but I've been having real problems keeping the Model from knowing it's a webapp and still being able to properly share a database connection. I'm still a beginner to java

Re: how to return errors from Model component

2002-09-06 Thread Eddie Bush
Jon.Ridgway wrote: >Hi All, > >As Ted has pointed out you might also want to get your messages from the >resource bundle, in which case you would just use the key to key into the >bundle (I have had a number of clients recently however that wanted to use >LDAP/RDBMS as a central store for localiz

RE: how to return errors from Model component

2002-09-06 Thread Jon.Ridgway
there any plans to extend Struts to support the storing of resources in a LDAP/RDBMS store?) Jon Ridgway -Original Message- From: Jon.Ridgway [mailto:[EMAIL PROTECTED]] Sent: 06 September 2002 16:41 To: 'Struts Users Mailing List' Subject: RE: how to return errors from Model

RE: how to return errors from Model component

2002-09-06 Thread wbchmura
BDY.RTF Description: RTF file

RE: how to return errors from Model component

2002-09-06 Thread Jon.Ridgway
Hi Donald, The approach I have used is to define a base exception that contains a map of error messages. Have your business exceptions extend this. In the struts action class catch the exception and morph them into ActionErrors, ie ActionErrors errors = new ActionErrors (); while (exception.has

RE: how to return errors from Model component

2002-09-06 Thread Donald Ball
On 9/6/2002 at 11:30 AM [EMAIL PROTECTED] wrote: >What kind of errors do you envision the model throwing up? Do you mean >an system error that is not supposed to happen (like the DB is not >available for some reason, or an >exception has occured?) or user type error like "Not finding a >reques

Re: how to return errors from Model component

2002-09-06 Thread Ted Husted
I generally use the second approach. The whole ResourceBundle concept is part of the Java platform and not Struts specific. So I have I my business classes return message tokens and any pertinent replacement parameters. The parameters do not usually need to be translated so this is usually no

Re: how to return errors from Model component

2002-09-06 Thread Tim T. Young
I would agree that your model should not be manipulating ActionError(s). If your requirement is that you MUST send multiple errors back from the model then perhaps a custom exception (with a list of other exception, errors string, or keys to i18n, internal to it), that you can pick apart in the A

RE: how to return errors from Model component

2002-09-06 Thread wbchmura
BDY.RTF Description: RTF file