Hello,

        If action chaining is a design error, then the struts-example that
comes with struts distributions has a design error, saveSubscription
forwards to editRegistration.do!

        Anyway, what I do is keep validation off action classes, by moving
them off to action forms using validator and/or overridden validate()
methods. (Business logic validations that need access to the data model must
be in the model ofcourse, and not in action classes.)

Cheers,
Krishna

-----Original Message-----
From: Nicolas De Loof [mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2003 2:05 PM
To: Struts Users Mailing List
Subject: best practice to avoid chaining actions


Hi all,

I've read on this list that chaining actions is considered as a design
error.

On the project I'm working on, some developers need to make some business
validation on a form before going to the next
page. This validation occurs in an Action class, let's say Action1.
>From business validation point of view, Action1 return "success" or "error".

Next page needs some pre-computing to select JSP and display, because of
some list of values that are time and
user-dependant.
>From next-page precomputing point of view, forward can be "simple-select" or
"multi-select"

What is the best way :

- Action1 validates, Action2 computes datas before page2 display, and we
need to chain Action1 and Action2.

- Action1 both validates ans computes datas for page2. It doesn't seems to
be good as this mix to roles in Action1 and
we cannot display page2 without validating.


Is they're a "good way" to do this without some workflow extension ?

Thanks for any help or suggestion.


---------------------------------------------------------------------
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]

Reply via email to