On Mon, 25 Jun 2001, Jay Walters wrote:
> Just to bounce this off of people, the ActionForm is really just for
> handling Form based input data from the user.
>
Yes, that is what it's designed for.
> What do people do to handle result data which is view only. We are thinking
> we will just put the model beans into our request object in the
> action.perform method and pull them out to use in the jsp. Does this make
> sense? Any reason we should be using forms for output of read only data?
>
Model beans will work just fine (with one caveat mentioned
below). Simply use things like the <bean:write> tag, with both "name" and
"property" attributes, to access the data you need.
The caveat relates to entity EJBs. Even though this will technically work
(if they follow the usual JavaBean naming patterns for properties), you
will not want to do this -- because each property getter call is
potentially remote (back to your EJB tier). What most people do for this
scenario is to have their EJBs return a "Value Object" that contains all
the property values you might be interested in, in a single call, and then
use the value object as a bean within Struts.
> Cheers
> Jay
>
Craig McClanahan