Hello,
I am trying to iterate through a HashMap<RecmExclusionCntctReasonKey,ArrayList<ContactReasonInfo>> using logic:iterate.
The error I am receiving is:
javax.servlet.jsp.JspException: No collection found.
Here is my
JSP:
<logic:iterate id="recmExclusionCntctReasonKey" property="recmExclContactReasonMap" name="requestContainerForm">
<tr>
<logic:equal name="requestContainerForm" property="readOnly" value="false">
<td><html:select property="key" name="recmExclusionCntctReasonKey" indexed="true">
<html:optionsCollection name="requestContainerForm" property="recmData.chanOrgList" label="description" value="code" />
</html:select></td>
<td>
<div id="tableContainer" class="tableContainer">
<table width="100%" height="5%" align="center" class="scrollTable" id="assignedTable">
<tbody class="scrollContent">
<logic:iterate id="recmExclContactReasons" name="requestContainerForm" property="recmExclContactReasonMap.value" type="java.util.ArrayList" indexId="iExclRsns">
<tr>
<td width="5%" align="left"> <html:checkbox name="recmExclContactReasons" property="checkedExclusionReason" indexed="true"></html:checkbox></td>
<td align="left"> <html:text name="recmExclContactReasons" property="contactReasonDesc" indexed="true" readonly="true" maxlength="30" size="30"/></td>
</tr>
</logic:iterate>
</tbody>
</table>
</div>
</td>
</logic:equal>
</tr>
</logic:iterate>
Here's what is in RequestContainerForm:
private HashMap<RecmExclusionCntctReasonKey,ArrayList<ContactReasonInfo>> recmExclContactReasonMap = new HashMap<RecmExclusionCntctReasonKey,ArrayList<ContactReasonInfo>>();
public RecmExclusionCntctReasonKey getRecmExclusionCntctReasonKey(int index) {
if (this.recmExclContactReasonMap == null) {
this.recmExclContactReasonMap = new HashMap<RecmExclusionCntctReasonKey,ArrayList<ContactReasonInfo>>();
}
while (index >= recmExclContactReasonMap.size()) {
recmExclContactReasonMap.put(new RecmExclusionCntctReasonKey(),RecommendationLoader.toContactReasonInfo(getRecmData().getContactReasonList()));
}
ArrayList<RecmExclusionCntctReasonKey> aList = new ArrayList<RecmExclusionCntctReasonKey>(this.recmExclContactReasonMap.keySet());
return (aList.get(index));
}
public HashMap<RecmExclusionCntctReasonKey, ArrayList<ContactReasonInfo>> getRecmExclContactReasonMap() {
return recmExclContactReasonMap;
}
public void setRecmExclContactReasonMap(
HashMap<RecmExclusionCntctReasonKey, ArrayList<ContactReasonInfo>> recmExclContactReasonMap) {
this.recmExclContactReasonMap = recmExclContactReasonMap;
}
And here's what is in RecmExclusionCntctReasonKey
private
String chanBusOrgCde = "";
private String effDt = "";
private String expDt = "";
with appropriate getters, setters, hashCode, and equals by chanBusOrgCde.
I see the populated HashMap before
Struts does the "forward", so I know the data is there. Any help would be greatly appreciated.