Hi all,
I created some sort of mapBacked form. First I defined my DynaBean in
the Struts config.
Then I call an Action which fills the HashMap with data. Then I display
the form (JSP) and
forward it to an DynaActionForm and try to validate it.
BUT I'm not able to get the data!
ANY IDEAS - what I do wrong?
Oliver
Struts-config.xml
<form-bean name="mapForm" type="struts.form.mapForm" />
<form-property name="mappedForm" type="java.util.HashMap" />
<form-property name="static" type="java.lang.String" />
</form-beans>
Action:
HashMap mapForm = new HashMap();
mapForm.put("username", "");
mapForm.put("email", "");
mapForm.set("mapForm", mapForm);
JSP:
<logic:iterate id="mapForm" name="mapForm">
<TR>
<TD width="40%"><bean:write name="mapForm" property="key"/>:</TD>
<TD><input type="text" name="f<bean:write name="mapForm"
property="key" />" value="<bean:write name="mapForm" property="value"
/>" class="Feld"></TD> </TR>
</logic:iterate>
FORM:
String static = (String)this.get("static");
HashMap mappedForm = (HashMap)this.get("mappedForm");
String username = (String) mappedForm.get("username");