struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <>
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. 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:
> For additional commands, e-mail:

Ted Husted,
   Junit in Action  - <>,
   Struts in Action - <>,
   JSP Site Design  - <>.

"Get Ready, We're Moving Out!!" - <>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message