Type should be available as an attribute of the iterate tag. Which tld are you using? 
The tld and the documentation are generated from the same xml file so they shouldn't 
be out of sync. 

I think the iterate tag exposes the index for use by nested custom tags, but I don't 
know if any tags in struts make use of the exposed index. Maybe you have to write your 
own tag to access it?

Hal

> -----Original Message-----
> From: Amos Shapira [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 22, 2001 7:19 AM
> To: '[EMAIL PROTECTED]'
> Subject: How to use the new iterate tag?
> 
> 
> Hello,
> 
> I'm using Struts-1.0-b2.
> 
> I'm trying to iterate over an array of objects using the iterate tag
> as follows:
> 
> <logic:iterate id         = "header"
>                collection = "<%= headers %>"
>                type       = "some.class">
> 
> But I get an error like:
> 
> Attribute type invalid according to the specified TLD
> 
> And indeed it looks like the "type" attribute is not specified
> in the TLD, contrary to what the documentation says.
> When I try to drop the "type" attribute I see in the .java class
> that Tomcat defines "header" as a "java.lang.Object" and obviously
> fails later when I access class methods. I also tried to declare
> "header" using "useBean", but I get a "variable already defined"
> error.
> 
> Does anyone know what am I doing wrong?
> 
> Also, I read in the documentation that now the iteration tag
> exposes the current index number, can anyone show me how can
> I access this from a JSP page?  I couldn't find an example in
> the distribution.
> 
> Thanks,
> 
> --Amos Shapira
> 

Reply via email to