Hi All,
//in
java
Collection coll = new ArrayList();
coll.add(crs.getString(1));
coll.add(crs.getString(2));
request.setAttribute("coll ",coll );
where crs is the cachedrowset object.
//in
jsp
<c:forEach items="${coll }" var="nameObj" varStatus="record">
<tr>
<td><c:out value="${nameObj.var1}"></c:out></td>
<td><c:out value="${nameObj.var2}"></c:out></td>
</tr>
I am getting the following Exception:
javax.servlet.jsp.JspException: An error occurred while evaluating custom action
attribute "value" with value "${nameObj.var1}": Unable to find a value for "var1
" in object of class "java.lang.String" using operator "." (null)
Now my question is how will the coll obj know that the values added are var1 and var2.
because even if i am putting all the values to coll obj i dont hav to display all .So somhow i need to access them using the var1 and var2.
If i will directly give:
<c:out value="${coll }"></c:out>
Then this prints all the vales with comma separated.How can i segregate that 1sr record will have values as var1 and var2,then 2nd record will hav its var1 and var2,etc...
Thanks
Amarshi