Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Array not recognized in logic:iterate tag

 
Tim Storms
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Tim Storms
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that! Again a very useful answer from your side!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic