How can we access the bean attribute in JSP?
I tried
<core:forEach var="header" items="${command.headerList}" >
<td><core:out value="${header.columnName}"/></td>
</core:forEach>
where headerList is the list of myBean which is having the attribute columnName [ getter / setter are defined in the class ]
Expected:
it should print the value in columnName
Actual:
it is not printing anything at all
also how can i access the nth element in the List? i tried
${command.headerList[i]}
Output:
nothing displayed.
Edit:#
When i write
${command.headerList}
it displays
com.bean.MyBean@14ecb90, com.bean.MyBean@169b35, com.bean.MyBean@27d572
This is just to let you know that the list is having something
and when i write
${header}
inside the forEach loop it displays:
javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects$7@d9d714
That means even header is having value, then why i am unable to print values using
${header.columnName}