【发布时间】:2011-07-26 12:53:50
【问题描述】:
我在 jstl 中写了一段代码。执行 html 时出现以下错误。
我可以在 c:set 的 value 属性中调用一个方法吗?如果不能,请帮助我如何做到这一点。
例外:
com.sun.facelets.tag.TagAttributeException: /role/MyPage.xhtml @33,82 value="#{roleManager.roleStatus(roleId)}" Error Parsing: #{roleManager.roleStatus(roleId)}
代码:
<select name="123">
<c:forEach items="#{roleManager.addRoleList}" var="category">
<c:set var="roleId" value="#{category.value}" />
<c:set var="roleIdValue" value="#{roleManager.getRoleStatus(roleId)}" />
<c:if test="${roleIdValue}">
<option value="#{roleId}" style="color:#990000;"> <h:outputLabel value="#{category.key}" /></option>
</c:if>
<option value="123"> <h:outputLabel value="#{category.key}"/></option>
</c:forEach>
</select>
【问题讨论】: