File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Array not recognized in logic:iterate tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Array not recognized in logic:iterate tag" Watch "Array not recognized in logic:iterate tag" New topic
Author

Array not recognized in logic:iterate tag

Tim Storms
Ranch Hand

Joined: Apr 27, 2006
Posts: 64
I'm having a problem with a html:multibox tag inside a logic:iterate tag. When the page is entered, I get the following error: "Null attribute name".

Some pieces of my code:
The form bean:

A piece of my jsp page:

As you can see, I'd like to use a String array in my form bean to be iterated on my jsp page. Any ideas why this error message is shown? Why doesn't it recognize the array?

Thanks!


SCJP 1.5, SCWCD 1.4, SCBCD 5
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
While any of the <html:xxx> tags automatically assume the name attribute to be the ActionForm bean name, the <logic:iterate> tag does not.

Change your <logic:iterate> tag to:

<logic:iterate id="apps" name="myForm" property="items">

where "myForm" is the name of your ActionForm bean.
[ July 31, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Tim Storms
Ranch Hand

Joined: Apr 27, 2006
Posts: 64
Thanks for that! Again a very useful answer from your side!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Array not recognized in logic:iterate tag
 
Similar Threads
checkbox iterate
Urgent Help Required with Checkboxes!
checkbox - initial value
On htm:multibox
Problem using html:radio