Hi!
Any clues to how to access HashMap through a key with struts?
Strut documentation is very vague on this subject.
here a sample of what i tried and it doesn't werk even though it compiles...

<bean:define id="hashOfUsers" name="prepareUsersForRoleForm"
property="usersWithRoles" type="java.util.HashMap"/>
<bean:define id="arrayOfRoles" name="hashOfUsers" property="[<%="" +
userId.intValue() %>]" type="java.util.ArrayList"/>

so the above compiles but whn i try to iterate the  'arrayOfRoles' it says
that there is no collection. strangely enough there is no collection as i
can not even access the 'arrayOfRoles'  through the scriplet.

here's what i do instead and it worx but i want it to be purely in struts..

<iterate id='user'........>
<% int id = ((User)user).getId();
   roles = (ArrayList)((HashMap)hashOfUsers).get("" + id);
for(int i = 0; i < roles.size(); i++){
%>
<%=((Role)roles.get(i)).getName()%>
<%}%>
</iterate>

Thanks !
Eugene


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

Reply via email to