You've found a documentation bug, which I have just submitted to the bug
database.

As you discovered, you need to use an expression (e.g. <%= value %>) rather
than a scriptlet (e.g. <% method(); %>) because the value needs to be
returned so that it can be used in the attribute.

--
Martin Cooper


----- Original Message -----
From: "Jim Richards" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 24, 2001 7:14 PM
Subject: never ending iterate tag questions


>
> I've now got the <logic:iterate ...> tag to work, but I'm confused about
how it
> works with the collection attribute. I've seen examples for people where
they
> have
>
> <logic:iterate id="bean" collection="<%= someObject.getValues() %>">
> ... do something with bean ...
> </logiv:interate>
>
> but the documentation
>
>
http://jakarta.apache.org/struts/api/org/apache/struts/taglib/logic/package-
summary.html#package_description
>
> indicates that it should be used thus:
>
> <logic:iterate id="bean" collection="<% someObject.getValues() %>">
> ... do something with bean ...
> </logiv:interate>
>
> The difference here being the "=" inside the scriptlet for the collection
attribute.
> When I don't have the "=" as the documentation suggests, I get
>
> Unable to convert a String to java.lang.Object for attribute collectio
>
> and if I do use the "=", which seem to be the correct way, looking at the
generated
> Java code, I get the correct response.
>
>
>
>
>
>
> --
> Kumera - a new Open Source Content Management System
> for small to medium web sites written in Perl and using XML
> http://www.cyber4.org/kumera/index.html


Reply via email to