Action chaining isn't just to access logic in two separate action classes,
but is often necessary when intermediate input is required from the user,
for example complex forms which need to be broken down into multiple pages,
wizards if you like.

Since Struts 1 we have been sticking the user entered data in the session
scope, which poses its own problems. I thought the big advantage of S2 was
the ability to "easily" implement action chaining and let the framework deal
with how to persist the data across multiple requests. But I'm finding that
it's not the case.

Z. 

> This is usually called "action chaining"
> 
>  * http://struts.apache.org/2.x/docs/action-chaining.html
> 
> Experience shows that chaining should be used with care. If chaining
> is overused, an application can turn into "spaghetti code". Be sure to
> ask yourself why you need to chain from Action1 to Action2. Could the
> logic in Action2 be pushed back to a support class or business facade
> so that Action1 can call it too?
> 
> Ideally, Action classes should be as short as possible. All the core
> logic should be pushed back to a support class or a business facade,
> so that Actions only call methods. Actions are best used as adapters,
> rather than as a class where coding logic is defined.
> 
> -- HTH, Ted
> <http://www.husted.com/ted/blog/>
> 
> 
> 
> On 10/4/07, ros <[EMAIL PROTECTED]> wrote:
>> 
>> Hi!
>> 
>> I use struts2 and want to load object in action1 and then access in in
>> action2 and result jsp, like on drawing
>> 
>> my1.html -(myobject.id)-> action1.save -(myobject)-> action2.edit
>> -(myobject)-> my2.jsp -> my2.html
>> 
>> I do not want to load this object in action2.edit if it was already loaded
>> in action1.save.
>> 
>> Can struts2 pass objects from action to action?
>> 
>> Thanks.
>> 
>> 
>> --
>> View this message in context:
>> http://www.nabble.com/how-to-keep-object-from-action-to-action-tf4569127.html
>> #a13040888
>> Sent from the Struts - User mailing list archive at Nabble.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]

Reply via email to