From: pinik on 26 Mar 2010 13:49 Hi, I am trying to use <logic:iterate> tag to retreive values and keys from HashMap. Using 2 different HashMaps for display and below are declarations. 1) HashMap1 ----- HashMap<Integer , ArrayList > 2) HashMap2 ----- HashMap<Integer , HashMap > I have to iterate and fetch the key from HashMap1 and check against to the Key from HashMap2 . If both keys are equal then i have to perform some functionality. Its been successful iterating the hashmaps but i have a problem checking both the keys for equal condition. Not sure what iam doing wrong in the code when checking for equal. It never executes. Is this the right way to check for keys. Please help with this. Thanks. code snippet <!-- First hashmap <Integer , ArrayList> --> <logic:iterate id="map1" name="myForm" property="mailingSchemeMap"> <bean:define id="map1Key" name="map1" property="key" type="java.lang.Integer"/> <!-- second hashmap <Integer , hashmap> --> <logic:iterate id="map2" name="myForm" property="schemeMap"> <bean:define id="map2Key" name="map2" property="key" type="java.lang.Integer"/> <!-- check if both key's are equal --> <logic:equal name="map2Key" value="map1Key"> <% out.println( "logic equal working " ); %> <bean:write name="map2" property="key"/> <!-- get First hashmap value (Arraylist) --> <nested:iterate id="rep" name="map1" property="value" type="com.GroupVO" indexId="indRepId"> <bean:write name="rep" property="Name"/> </nested:iterate> </logic:equal> </logic:iterate> </logic:iterate>
|
Pages: 1 Prev: JSplitPane, some problem Next: VDC is Interested in Your Engineering Experiences |