First of all, note that you could use "c:forEach" instead of "logic:iterate". You should be able to do it with both, but there's no sensible reason to use both kinds of iteration constructs.
The critical problem is likely that the "collection" attribute is an RT expression that evaluates to a collection. Your value is a string, not a collection. > -----Original Message----- > From: Wessel van Norel [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 15, 2004 7:04 AM > To: Struts Users Mailing List > Subject: Question about using a HashMap as input for logic-el:iterate > > > Hi all, > > I was wondering if it is possible to use a HashMap containing > vectors as the input for a logic-el:iterate tag. > > Why do I use a hashmap? That's because I first have to > iterate through a list of questionnaires, and per > questionnaire I've a list of questions. The hashmap has the > questionnaire ID as it's key, and the vector with questions > as object. Now I was trying the following to get the vector > out of the hashmap (like getting the value of something from > a map-backed form): > > <c:forEach var="questionnaire" items="${questionnaires}"> > <optgroup label="${questionnaire.name}"> > <logic-el:iterate id="question" > collection="questions(${questionnaire.id})"> > <html:option value="anwe_${question.id}"><c:out > value="${question.name}" /></html:option> > </logic-el:iterate> > </optgroup> > </c:forEach> > > This doen't work, giving me the following error: > Cannot create iterator for this collection > > The questionnaires Vector and questions HashMap are both in > the request scope. > > Is what I'm trying to do not possible with logic-el:iterate, > or am I missing something? > > Regards, > Wessel van Norel > -- > Spread Firefox: http://www.spreadfirefox.com/?q=user/register&r=15629 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]