Indeed, I need help. I wrote it : <logic:iterate name="questionnaireForm" property="map" id="item" > <bean:write name="item" property="key" /> - <bean:write name="item"property="value"/> /><br/> </logic:iterate>
Which gives me an error telling there is no getter for property map while in the struts javadoc for org.apache.struts.action.DynaActionForm : java.util.Map getMap() Returns the Map containing the property values. Thanks for your help, what you gave me works just fine. Rémi Le Lundi 27 Juin 2005 22:23, Wendy Smoak a écrit : > From: "Dewitte Rémi" <[EMAIL PROTECTED]> > > > I'm quite new in struts and i'd like to print all properties of my form > > with > > > their corresponding value. I don't manage to do this with iterate. Could > > you > > > please suggest me a solution ? > > my bean name is QuestionnaireForm defined in struts-config: > > <form-bean name="QuestionnaireForm" > > type="org.apache.struts.validator.DynaValidatorForm"> > > Do you just want to see what's in the form, for debugging purposes? > > If so, you don't have to iterate, just do: > <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> > <c:out value="${QuestionnaireForm}" /> > (or <bean:write name="QuestionnaireForm" /> ) > > This just calls the 'toString' method on the form. In this case, > DynaValidatorForm prints out its internal Map. > > If you do need to iterate over the form contents, ask the form for its Map, > then print out the key and value of each MapEntry: > > <c:forEach items="${contactForm.map}" var="item" > > <c:out value="${item.key}" /> - <c:out value="${item.value}" /><br/> > </c:forEach> > > If you need help translating to <logic:iterate>, let us know. (Also, you > might want to make your form name start with a lower-case letter. > Otherwise it looks like a class name instead of an instance.) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]