struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <hus...@apache.org>
Subject Re: [SCAFFOLD] Elegant way to expose more than one object using Proc essAction
Date Tue, 23 Sep 2003 01:25:54 GMT
You can also return a ProcessResult that is a collection of 
ProcessResults. Just setAggregate to true on the "outer" result and then 
start adding the others. When it comes back, the ProcessAction will run 
through the collection of ProcessResults and handle each in turn. 
(Composite pattern.) Handling would include automatically exposing each 
result in the chosen scope.

So, yes, there is =:)

HTH, Ted.

aies22@ardom.ardom.co.il wrote:
> Hi,
> 
> When using the Scaffold ProcessAction, a data-bean is instantiated by the
> framework and it's execute() method is called, returning a ProcessResult
> object to the view layer.
> 
> The ProcessResult object may contain a single object or a collection (of
> values or objects).
> 
> Suppose I want to return to the view layer a collection of some sort AND a
> single object which has nothing to do with that collection.
> 
> In order to do that, what I do now is to create another helper collection in
> which I store both the single object\s and the collection I wish to send to
> the view layer. Then I return this helper collection as a ProcessResult
> object to the view layer, where I have to extract back both the collection
> and the single object as separate entities, and define them as beans.
> 
> Is there a more elegant way to expose a number of objects\collections of
> different types using a single call to ProcessAction?
> 
> Thanks,
> Noam
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 

-- 
Ted Husted,
   Junit in Action  - <http://www.manning.com/massol/>,
   Struts in Action - <http://husted.com/struts/book.html>,
   JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.

"Get Ready, We're Moving Out!!" - <http://www.clark04.com>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message