> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@;octo.com]
> 
> 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.

Gee, this sounds familiar :) .  I just went through this a few weeks
ago.

The JSTL EL only (at this time) works with standard javabeans
properties.  If it doesn't have a standard getter method, you can't get
it.

It's unfortunate that DynaBean doesn't assume it will be backed by a Map
implementation (of some kind), then it would have been reasonable to
have a "getMap()" method, which would have made this conversation
unnecessary.

I changed the Struts DynaActionForm class to add a "getMap()" method,
which made it so that DynaActionForm objects could be referenced in EL
expressions, either using the JSTL, or using Struts-EL (the contributed
library to Struts which uses the JSTL EL for attribute values).

Without using a subclass that provides the getter, or changing DynaBean
and its standard implementations, you can't do it.

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>

Reply via email to