【发布时间】:2014-04-09 02:36:45
【问题描述】:
我需要在struts 1.x的jsp中获取form bean的值
我正在尝试以下代码,但这无济于事。
<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>
我可以使用以下标签获取表单 bean 值
但是当我这样尝试时它不起作用
<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>
请帮助如何获取此formBean 属性值。
【问题讨论】:
-
propertyName有吸气剂吗?并且您是否添加了任何 bean 实例,其键为formBeanName??