F
Frederic
Hi all,
I have a problem with JSTL. I have in session an Map with a String as a
key and a collection as value. I would like to iterate throught all key,
and for each key, itearate througt collection value.
Here is a jsp code that work great
<c:forEach var="objectType" items="${QUERYRESULT.typeList}">
<cut value="${objectType}"/> -
<logic:iterate id="leo" name="QUERYRESULT" property =
"objects(${objectType})">
<bean:write name="leo" property="name.value"/><br/>
</logic:iterate>
</c:forEach>
with this bean
SortedMap tm = new TreeMap();
public Collection getTypeList() {
return tm.keySet();
}
public Collection getObjects(String objectType) {
return (Collection) tm.get(objectType);
}
I'm trying to use a second foreach tag to access collection value
<c:forEach var="eo" items='${QUERYRESULT.objects[objectType]}'>
${eo.name.value}
</c:forEach>
but it's not working, it's not even calling getObjects method ...
what's wrong ? I tries many solution with name index.
Thanks
Fred
I have a problem with JSTL. I have in session an Map with a String as a
key and a collection as value. I would like to iterate throught all key,
and for each key, itearate througt collection value.
Here is a jsp code that work great
<c:forEach var="objectType" items="${QUERYRESULT.typeList}">
<cut value="${objectType}"/> -
<logic:iterate id="leo" name="QUERYRESULT" property =
"objects(${objectType})">
<bean:write name="leo" property="name.value"/><br/>
</logic:iterate>
</c:forEach>
with this bean
SortedMap tm = new TreeMap();
public Collection getTypeList() {
return tm.keySet();
}
public Collection getObjects(String objectType) {
return (Collection) tm.get(objectType);
}
I'm trying to use a second foreach tag to access collection value
<c:forEach var="eo" items='${QUERYRESULT.objects[objectType]}'>
${eo.name.value}
</c:forEach>
but it's not working, it's not even calling getObjects method ...
what's wrong ? I tries many solution with name index.
Thanks
Fred