You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dennis <de...@iswsolutions.com> on 2001/01/04 18:52:53 UTC
Problem with Logic:Iterate
Hello,
I'm new to struts, and trying to kick the tires a little but I'm having a
problem using the iterate tag. I have a Bean called DataObjects that
contains a Vector called 'objects'. The vector contains beans with a single
member variable called 'name'. In the Action class, I use
request.setAttribute("dos", objects)
to make the bean visible. When I use the following in my .jsp file, I get
an error stating "javax.servlet.ServletException: No bean found for
attribute key row". It must be something simple, but I can't seem to find
the problem.
<logic:notPresent name="dos"><logic:redirect
href="error.jsp"/></logic:notPresent>
<logic:iterate id="row" name="dos" property="objects">
<li>
<bean:write name="row" property="name"/>
</li>
</logic:iterate>
Can anyone help?
Thanks,
Dennis
Re: Problem with Logic:Iterate
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Dennis wrote:
> Hello,
>
> I'm new to struts, and trying to kick the tires a little but I'm having a
> problem using the iterate tag. I have a Bean called DataObjects that
> contains a Vector called 'objects'. The vector contains beans with a single
> member variable called 'name'. In the Action class, I use
> request.setAttribute("dos", objects)
> to make the bean visible. When I use the following in my .jsp file, I get
> an error stating "javax.servlet.ServletException: No bean found for
> attribute key row". It must be something simple, but I can't seem to find
> the problem.
>
There was a bug in the iterate tag a couple of weeks ago, where it would not
actually create the "row" variable for you. This has been fixed with recent
nightly builds -- could you try it again with last night's?
Craig