Help with Struts tag <logic:equal>

P

pinik

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top