java不能在f:attribute中使用JSF2.0EL表达式吗?
当我使用以下代码时,我得到了java。lang.IllegalArgumentException错误
<h:dataTable value="#{toDoBean.toDoItemList}" var="toDoItem" >
<h:column>
<h:selectBooleanCheckbox value="#{toDoItem.finsh}"
valueChangeListener="#{toDoBean.onStatusChange}"
onchange="submit()"/>
</h:column>
<h:column>
<h:outputText value="#{toDoItem.title}"/>
</h:column>
<h:column>
<h:commandButton value="X" actionListener="#{toDoBean.onDelete}">
<f:attribute name="id" value="#{toDoItem.title}" />
</h:commandButton>
</h:column>
</h:dataTable>
但是如果我换了
<f:attribute name="id" value="#{toDoItem.title}" />
与
<f:attribute name="id" value="testing" />
然后一切正常
所以我的假设是“我不能将EL与f:attribute一起使用”
- 我说得对吗李>
- 为什么?李>
- 有没有办法在f:attribute中使用el李>
# 1 楼答案
您的toDoItemList列表是否具有字段标题?如果是的话,标题中是否有getter和setter? 同时也请复习
jsf f:attribute