如何在struts 1.x的JSP中获取表单Bean值

izj3ouym  于 2022-12-07  发布在  其他
关注(0)|答案(1)|浏览(123)

我需要在struts 1.x中获取jsp格式的表单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属性值。

lymnna71

lymnna711#

end='${formBeanBame.propertyName}'

您不能在另一个JSP标记的属性中使用JavaServer Pages(JSP)标记。访问bean的属性只需要JSP表达式语言(EL)。

相关问题