title: Dynamically name struts2 textfield
body: <p>I am trying to write a JSP that contains a struts 2 textfield tag as follows: </p>
  
  <p></p>
  
  <p>I would like to dynamically assign a name to this textfield using the value of a variable I declare earlier in the code as follows: </p>
  
  <pre><code>&lt;s:if test="patient.procedureCode.size &gt; 0"&gt;  
  
  &lt;% int i=0;%&gt;  
  
  &lt;s:iterator value="patient.procedureCode" id ="procedureCode"&gt;      
  
      &lt;%i++; %&gt;  
  
      &lt;% if((i%2) &gt; 0) { %&gt;    
  
          &lt;tr   class="dbText" &gt;  
  
              &lt;td &gt;  
                  &lt;s:checkbox value="false" fieldValue="%{#procedureCode.objectid}" name="objectid" theme="simple" /&gt;  
              &lt;/td&gt;           
  
              &lt;td class="BasicText" &gt;                             
                  &lt;s:textfield value="%{proceddateVar}" size="10"  theme="simple" readonly="false" name=""/&gt;  
              &lt;/td&gt;  
          &lt;/tr&gt;       
      &lt;%} %&gt;  
  
  &lt;/s:iterator&gt;  
  </code></pre>
  
  <p></p>
  
  <p>I would like to give the textfield a name that is equal to the current value of the variable i.
  Please advice.</p>