我正在eclipse上使用hibernate spring和JSF开发一个Web应用程序我已经创建了页面:ReclamationList.jsp来列出所有回收
当我在第一页提交我的表单代码时出现错误。
这是我的页面:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> Liste des reclamations</title>
</head>
<body>
<f:view>
<h:form id="mainForm">
<rich:scrollableDataTable id="reclamationTable" binding="#{reclamationBean.reclamationTable}" value="#{reclamationBean.reclamationList}"
var="reclamation" width="300px" height="200px">
<rich:column id="objet" width="60px">
<f:facet name="header"><h:outputText value="objet"/> </f:facet>
<h:outputText value="#{reclamation.objet}"/>
</rich:column>
<rich:column id="dateCreation" width="60px">
<f:facet name="header"><h:outputText value="dateCreation"/> </f:facet>
<h:outputText value="#{reclamation.dateCreation}"/>
</rich:column>
<rich:column id="priorité" width="60px">
<f:facet name="header"><h:outputText value="priorité"/> </f:facet>
<h:outputText value="#{reclamation.priorité}"/>
</rich:column>
</rich:scrollableDataTable>
</h:form>
</f:view>
</body>
</html>
我的类 bean 是 ReclamationBean.java:
package web;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import org.richfaces.component.html.HtmlScrollableDataTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import DAO.Reclamation;
import service.ReclamationService;
@Component("reclamationBean")
@Scope("session")
public class ReclamationBean implements Serializable {
@Autowired
private List<Reclamation> reclamationList;
private transient ReclamationService reclamationService;
private transient HtmlScrollableDataTable reclamationTable;
public List<Reclamation> getReclamationList() {
return reclamationList;
}
public void setReclamationList(List<Reclamation> reclamationList) {
this.reclamationList = reclamationList;
}
public HtmlScrollableDataTable getReclamationTable() {
return reclamationTable;
}
public void setReclamationTable(HtmlScrollableDataTable reclamationTable) {
this.reclamationTable = reclamationTable;
}
}
这是我提交页面时遇到的错误:
org.apache.jasper.JasperException: javax.faces.FacesException: javax.faces.el.PropertyNotFoundException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'reclamationBean' resolved to null