You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ZYD <el...@hotmail.com> on 2003/11/06 03:19:53 UTC

Can the "name" attribute be omitted form html:iterate tag ?

Hi

The following two code snippets are from Struts in Action, I copied them to my JSP page and ActionForm.
but I cannot get it work. 
I got :
[ServletException in:/WEB-INF/jsp/form/multiboxTestSubmit.jsp] Null attribute name'

What's wrong with it?  What do I need to pay attention to?
Please help me out of this, I have been puzzled by it for several days.

Thanks in advance.

bruce

<logic:iterate id="item" property="items">
 <html:multibox property="selectedItems">
  <bean:write name="item"/>
 </html:multibox>
 <bean:write name="item"/>
</logic:iterate>

----------------------------------

     private String[] selectedItems = {};
     private String[] items = { "UPS", "FedEx", "Airborne" };
     public String[] getSelectedItems()
     {
          return this.selectedItems;
     }
     public void setSelectedItems(String[] selectedItems)
     {
          this.selectedItems = selectedItems;
     }