struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: iterate needs "class" attribute
Date Fri, 23 Mar 2001 18:12:54 GMT

On Fri, 23 Mar 2001, Taylor Cowan wrote:

> The iterate tag is similar to a <jsp:useBean tag...> in that it introduces a
> new scripting var.  It would be nice to have the <iterate> tag type cast the
> values from the iterator.
> Taylor Cowan

You can indeed specify the type of the scripting variable that is exposed:

<logic:iterate id="customer" name="customers"
  ... here, "customer" will be of class MyCustomerBean ...
  Customer name is <%= customer.getName() %>.

For most uses by Struts tags, this doesn't matter -- they will happily use
reflection to access properties from any object type.


View raw message