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"
type="com.mycompany.mypackage.CustomerBean">
... here, "customer" will be of class MyCustomerBean ...
Customer name is <%= customer.getName() %>.
</logic:iterate>
For most uses by Struts tags, this doesn't matter -- they will happily use
reflection to access properties from any object type.
Craig