HashMap doesn't implement the Collection interface, and has no method for
getting an iterator.

Look at the methods values(), keySet() & entrySet() on HashMap which do
return Collections.

Paul

> -----Original Message-----
> From: Wessel van Norel [mailto:[EMAIL PROTECTED]
> Sent: 15 December 2004 15:04
> 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]
> 

Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you 
are not the addressee indicated in this message (or responsible for delivery of 
the message to such person), you may not copy or deliver this message to 
anyone. In such case, you should destroy this message, and notify us 
immediately. If you or your employer does not consent to Internet email 
messages of this kind, please advise us immediately. Opinions, conclusions and 
other information expressed in this message are not given or endorsed by my 
Company or employer unless otherwise indicated by an authorised representative 
independent of this message.
 
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being 
transmitted via electronic mail attachments we cannot guarantee that 
attachments do not contain computer virus code.  You are therefore strongly 
advised to undertake anti virus checks prior to accessing the attachment to 
this electronic mail.  Axios Systems Ltd grants no warranties regarding 
performance use or quality of any attachment and undertakes no liability for 
loss or damage howsoever caused.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to