That's the way I'm looking to do it.

I have a class called BuisnessException that descends from Exception. This
is thrown and then I convert it to an ActionError within Struts. I plan to
give the oppotunity to nest them at a later date.



Sean


--------------------------------------------------
Dr Sean Radford, MBBS, MSc
Senior Consultant
Agora Professional Services Ltd
[EMAIL PROTECTED]
http://www.agora.co.uk
--------------------------------------------------
Agora Professional Services is an entrepreneurial consulting firm
specialising in e-Business and innovative solutions since 1995.




                                                                                       
                                             
                    David                                                              
                                             
                    Winterfeldt           To:     [EMAIL PROTECTED]       
                                             
                    <dwinterfeldt@        cc:                                          
                                             
                    yahoo.com>            Subject:     Re: validation in the form vs. 
validation in the business domain object      
                                                                                       
                                             
                    20/06/2001                                                         
                                             
                    08:05                                                              
                                             
                    Please respond                                                     
                                             
                    to struts-user                                                     
                                             
                                                                                       
                                             
                                                                                       
                                             




Someone I know extended Exception and they throw
nested exceptions that eventually are passed back to
the Struts layer and then an ActionError is
constructed for each exception.  Something like that
seems like a clean way to keep things separated.  I
did something similiar on a project with a Swing and
EJBs.

David

--- James Hoffa <[EMAIL PROTECTED]> wrote:
> What ideas do people have about where is the best
> place to perform validation of items that come back
> from ActionForms?
>
> Example: check to see if the user's choice of
> motherboard, memory, and cpu are compatible with
> each
> other.
>
> Following the struts example, it seems like the
> validate() method in an ActionForm is used only for
> light validation (i.e. checking to see if something
> was left blank, or checking for alpha and numeric
> chars). This approach seems correct to me, since
> there
> should not be business logic inside the ActionForm.
>
> That leaves most of the work to the business domain
> object since any nontrivial application will not
> have
> business logic in the Action class either.
>
> The business domain object, in many cases, will be
> accessed remotely from the Action class.
>
> Does it make sense for the business domain object to
> return an ActionErrors object(it is serializable)?
> I
> am not 100% comfortable yet with the idea of
> importing
> ActionErrors into the business object since it
> couples
> it to struts to a certain extent, and it could
> potentially be large.
>
> Is the only alternative to send back a list of
> generic
> error codes from the business object that each map
> to
> an ActionError and the Action class could add the
> ActionErrors? (i think i'd  rather import
> actionerrors
> in this case)
>
> What are some of the "best practices" people have
> found to work for this problem?
>
> Craig and ALL Struts creators:  Struts is really
> great. Thank you for all of your hard work. It is
> definitely something to be proud of.
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Reply via email to