开发者

Display iterate bean value in jsp

<logic:iterate id="requirement" name="requirementList" indexId="reqNumber">
        <a href="#" onClick="editItem('<%=requirement.service.description%>')">Edit</a>
</logic:iterate>

As you can see, my intention is to populate edit links with a variety of values that are drawn from a list. The "requirement" bean object displays fine with but I'm not sure how to get the value in J开发者_JAVA百科SP which would be much more useful when populating the javascript method calls.

Edit: Using Struts 1.x


If you want to use jsp to retrieve that one, that will be a pain in the ass like this.

((Requirment)pageContext.getAttribute("requirement")).getService().getDesciption();

If you use EL like some other suggested

${requirement.service.description}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜