Reputation: 1219
I need to get form bean value in jsp in struts 1.x
I am trying following code but that doesn't help.
<c:forEach begin="1" end='here I need that from bean value' var="i" >
<c:choose>
<c:when test="${param.pageNumberInput eq i}">
<td>
<c:out value="${i}" />
</td>
</c:when>
<c:otherwise>
<td>
<a href="#"><c:out value="${i}" /> </a>
</td>
</c:otherwise>
</c:choose>
</c:forEach>
I can get form bean value using the following tag
But when I try like this it doesn't work
<c:forEach begin="1" end='<bean:write name="formBeanName" property="propertyName" />' var="i" >
<c:choose>
<c:when test="${param.pageNumberInput eq i}">
<td>
<c:out value="${i}" />
</td>
</c:when>
<c:otherwise>
<td>
<a href="#"><c:out value="${i}" /></a>
</td>
</c:otherwise>
</c:choose>
</c:forEach>
Please help how to get this formBean
property value.
Upvotes: 0
Views: 12201
Reputation: 691585
end='${formBeanBame.propertyName}'
You can't use a JavaServer Pages (JSP) tag in an attribute of another JSP tag. And The JSP Expression Language (EL) is all you need to access properties of beans.
Upvotes: 0