<logic:iterate id="requirement" name="requirementList" indexId="reqNumber">
<a href="#" onClick="editItem('<%=requirement.service.description%>')">Edit</a>
</logic:iterate>
如您所见,我的目的是使用从列表中提取的各种值来填充编辑链接。 “requirement”bean 对象显示良好,但我不确定如何获取 JSP 中的值,这在填充 javascript 方法调用时会更有用。
编辑:使用 Struts 1.x
最佳答案
如果你想使用jsp来检索那个,那将是一件痛苦的事情。
((Requirment)pageContext.getAttribute("requirement")).getService().getDesciption();
如果您像其他建议一样使用 EL
${requirement.service.description}
关于java - 在jsp中显示迭代bean值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6522968/