我想在使用EL的JSP中使用具有参数的方法。但EL不支持方法中的参数。其实我想展示一个表格,它有一个在一个单元格中输出值列表的字段。对于每个单元格,这个列表将有所不同,这取决于参数。我如何使用EL来做到这一点?EL方法中的参数
我已经试过了,但说,它不能在 <c:set var="group" value="${entrant.idGroup}" />
其中entrant.idGroup
返回int值投整数转字符串
<c:forEach var="entrant" items="${bean.entrants}">
<tr>
<td>${entrant.idEntrant}</td>
<c:set var="group" value="${entrant.idGroup}" />
<td><%=bean.getGroupCode(Integer.parseInt((String)pageContext.getAttribute("group")))%></td>
<td>${entrant.name}</td>
</c:forEach>
但即使它的作品,我想用纯EL在JSP。我怎样才能做到这一点?
请不要混淆JSTL和EL。在你的问题中,你一直在谈论EL,就好像它是JSTL一样。我已经扫过了那一个。请阅读我们的wiki页面以了解其差异:http://stackoverflow.com/tags/jstl/info和http://stackoverflow.com/tags/el/info – BalusC 2011-06-13 22:38:04