我的文本字段有问题。 我有一个我不理解的错误PropertyNotFoundException。 感谢您的帮助。
我的代码:
实体:
@Entity
@Table(name = "RefCollectivite")
public class RefCollectivite implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int idPk;
private String libelle;
public RefCollectivite() {
}
/**
* @return the idPk
*/
public int getIdPk() {
return idPk;
}
/**
* @param idPk the idPk to set
*/
public void setIdPk(int idPk) {
this.idPk = idPk;
}
/**
* @return the libelle
*/
public String getLibelle() {
return libelle;
}
/**
* @param libelle the libelle to set
*/
public void setLibelle(String libelle) {
this.libelle = libelle;
}
ManagerBean:
@ViewScoped
@ManagedBean(name = "administrationManagerBean")
public class AdministrationManagerBean implements Serializable {
private RefCollectivite collectiviteCourante;
pageAdministration.xhtml:
<h:inputText
value="#{administrationManagerBean.collectiviteCourante.libelle}"/>
错误:
javax.el.PropertyNotFoundException:/pageAdministration.xhtml @ 84,155 value =“#{administrationManagerBean.collectiviteCourante.libelle}”:目标无法访问,“ null”返回null