commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: [Beanutils] DynaBean and JSTL EL
Date Tue, 12 Nov 2002 17:29:47 GMT
On Tue, 12 Nov 2002, Vincent Massol wrote:

> Date: Tue, 12 Nov 2002 15:28:18 -0000
> From: Vincent Massol <vmassol@octo.com>
> Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> To: 'Jakarta Commons Developers List' <commons-dev@jakarta.apache.org>
> 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>


Mime
View raw message