javax.el.PropertyNotWritableException:value =“”:集合操作的非法语法

时间:2012-12-04 23:53:05

标签: jsf el

我有这样的表格:

<h:form>
    <h:outputLabel value="Entrez un id du compte a supprimer" for="id"/>
    <h:inputText id="id" value=""/>
    <h:commandButton id="supprimer" value="Supprimer" action="#{compteBancaireMBean.supprimer}"/>  
</h:form>

这个动作方法:

public String supprimer() {  
    gestionnaireDeCompteBancaire.supprimer(comptebancaire.getId());  
    return "CompteList";  
} 

当我提交表单时,我收到以下异常:

javax.el.PropertyNotWritableException: /Supprimer.xhtml @14,44 value="": Illegal Syntax for Set Operation

这是如何引起的?如何解决?

1 个答案:

答案 0 :(得分:4)

value=""对JSF el解析器没有任何意义,它无法理解。您需要在value="Some Text"中实际提供静态值,或者将其绑定到辅助bean中的变量,如value="#{compteBancaireMBean.myVariable}"myVariable对应{{1}中的实际变量支持bean。此变量必须遵循javabean约定,即您必须具有

compteBancaireMBean