javax.el.PropertyNotWritableException:value =“”“:设置操作的非法语法 [英] javax.el.PropertyNotWritableException: value="": Illegal Syntax for Set Operation

查看:330
本文介绍了javax.el.PropertyNotWritableException:value =“”“:设置操作的非法语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这种形式:

<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 支持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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆