javax.el.PropertyNotWritableException:value =“”“:设置操作的非法语法 [英] javax.el.PropertyNotWritableException: value="": Illegal Syntax for Set Operation
问题描述
我有这种形式:
<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";
}
提交表单时,出现以下异常:
When I submit the form, I get the following exception:
javax.el.PropertyNotWritableException: /Supprimer.xhtml @14,44 value="": Illegal Syntax for Set Operation
这是怎么引起的,我该如何解决?
How is this caused and how can I solve it?
推荐答案
value =
对JSF el解析器没有任何意义,这没有任何意义。您实际上需要在那里提供一个静态值,例如 value = Some Text
或将其绑定到后备bean中的变量,例如 value =#{compteBancaireMBean.myVariable}
其中 myVariable
对应于 compteBancaireMBean $ c $中的实际变量c>支持bean。此变量必须遵循javabean约定,即您必须具有
value=""
does not mean anything to the JSF el parser, it can't make sense of that. You need to actually provide a static value there, as in value="Some Text"
or bind it to a variable in your backing bean as in value="#{compteBancaireMBean.myVariable}"
where myVariable
corresponds to an actual variable in your compteBancaireMBean
backing bean. This variable must follow the javabean conventions i.e. you must have
private Integer myVariable; //I use Integer here just as an example, you can use any core java type
public void setMyVariable(Integer myVariable){
this.myVariable = myVariable
}
public Integer getMyVariable(){
return this.myVariable
}
这篇关于javax.el.PropertyNotWritableException:value =“”“:设置操作的非法语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!