On Tue, 12 Nov 2002, Vincent Massol wrote:
> Date: Tue, 12 Nov 2002 15:28:18 -0000
> From: Vincent Massol <[EMAIL PROTECTED]>
> Reply-To: Jakarta Commons Developers List <[EMAIL PROTECTED]>
> To: 'Jakarta Commons Developers List' <[EMAIL PROTECTED]>
> Subject: [Beanutils] DynaBean and JSTL EL
>
> Hi,
>
> I'm trying to create a JSP page that will present a collection of
> DynaBeans into a table, using JSTL. I've attached what I've got so far
> (the "results" object is a Collection of DynaBean objects that have been
> put in the Request object by a Servlet).
>
> I am stuck where I need to get a property from a DynaBean.
>
The API way, of course is to call the get() method, but that doesn't help
you access it from JSTL.
In Struts, we recently added a getMap() method to ActionDynaForm (extends
BasicDynaBean) to return the underlying Map instance containing the
properties. This allows EL expressions like:
${customer.map.name}
to at least work on a DynaBean, even though the syntax is not transparent.
Such a thing could probably be added to BasicDynaBean as well, but I would
be -1 on adding it to the DynaBean interface itself -- there's no reason
to assume that every possible DynaBean implementation will have a Map
containing property values behind it.
> How can I do it?
>
> Thanks
> -Vincent
>
>
Craig
--
To unsubscribe, e-mail: <mailto:commons-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>