I need to create a hidden field in a form that is initialized to a value
that I am iterating over. (I am creating a form that allows a parent user to
manage their child usernames.) I tried something like this:
<table>
<logic:iterate id="aUser" name="myForm" scope="session" property="users">
<tr><td><bean:write name="aUser"/></td><td>
<html:form name="myForm" action="deleteUsername.do"
type="my.LogonForm" scope="session">
<bean:write name="aUser"/>
<html:hidden property="user"><bean:write name="aUser"/></html:hidden>
<html:submit>
<bean:message key="button.delete"/>
</html:submit>
</html:form>
</td></tr>
</logic:iterate>
</table>
The username displays correctly, so I know the bean:write tag is working
correctly.
However when I look at the source that is generated I see a hidden field
where the value is set to "". It seems like this should work, and it doesn't
cause any errors at runtime. The only way I have found to do it is by
replacing the html:hidden tag with:
<input type="hidden" name="user" value="<bean:write name="aUser"/>">
This seems really clunky to me. Am I doing something wrong? Is this a bug in
the tag?
Thanks for your help,
-Nick