title: Struts Hidden field does not hold the values
body: <p>I have a webpage display the list of values with the following data structure. </p>
  
  <pre><code>Class MyBean 
  private List&lt;NewObj&gt; newList;
  getNewList();
  setNewList(List);
  
  Class NewObj
  private String name;
  private List&lt;CustObj&gt; custList;
  getCustList();
  setCustList(List);
  
  Class CustObj
  private String age;
  </code></pre>
  
  <p>I am able to iterate through the list and display the values. I have included the hidden tags in between so that I can get the values in Action class back from Form. </p>
  
  <p><strong>JSP:</strong></p>
  
  <pre><code>&lt;s:iterator value="myBean.newList" status="matStat"&gt;
      &lt;s:hidden name="myBean.newList[%(#matStat.index)].name"&gt;&lt;/s:hidden&gt;
      &lt;tr&gt;
         &lt;td&gt;&lt;s:property value="name" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;s:iterator value="custList" status="reqStatus"&gt;
       &lt;s:hidden name="myBean.newList[%(#matStatus.index)].custList[%(#reqStatus.index)].requestId"&gt;         &lt;/s:hidden&gt;
       &lt;tr&gt;
          &lt;td&gt;&lt;s:property value="age" /&gt;&lt;/td&gt;
       &lt;/tr&gt;
     &lt;/s:iterator&gt;
  &lt;/s:iterator&gt;
  </code></pre>
  
  <p>When I try to access the values from my action class, the value is NULL, I mean the object myBean is NULL. </p>
  
  <p><strong>Action class:</strong></p>
  
  <pre><code>myBean.getNewList()
  </code></pre>
  
  <p>I am getting the NPE at the above line as the myBean object is empty. FYI, I have both getter and setter of myBean in the action class.</p>
  
  <p><strong>JSP Source from Browser:</strong> Following is the extract of content which I got from the browser by seeing the <strong>View Page Source</strong></p>
  
  <pre><code>&lt;input type="hidden" name="myBean.newList[%(#matStat.index)].name" value="" id="myForm_myBean_newList[%(#matStat.index)].name"/&gt;
  </code></pre>
  
  <p>The value of name should actually be <strong>myBean.newList[0].name</strong></p>