JSF 错误:/fstation/search.jspx(24,62) '#{vManager.fStations}' Property 'fStations' not found on type vm.beans.VisitorManagertype
vManager 是我管理的:
搜索.jspx
<h:form>
<h:dataTable value="#{vManager.fStations}" var="row">
<h:column>
<f:facet name="header"><h:outputText value="ID"/></f:facet>
<h:outputText value="#{row.id}"/>
</h:column>
<h:column>
<f:facet name="header"><h:outputText value="NAME"/></f:facet>
<h:outputText value="#{row.name}"/>
</h:column>
</h:dataTable>
</h:form>
管理代码如下:
package vm.beans;
import vm.model.DataManager;
import java.util.ArrayList;
import java.util.List;
public class VisitorManager {
private List<FireStation> fStations;
private DataManager dataManager = new DataManager();
private String fireStationName;
public String searchFireStation(){
//String fName =fStation.getName();
System.out.println("this is "+fireStationName);
return null;
}
public void deleteStation(){
}
/*
* getter and setter
*/
public String getFireStationName(){
return fireStationName;
}
public void setFireStationName(String name1){
this.fireStationName=name1;
}
public List<FireStation> getFStations(){
//return dataManager.getFireStations();
fStations = new ArrayList<FireStation>();
fStations.add(new FireStation("001", "a1"));
fStations.add(new FireStation("002", "a2"));
fStations.add(new FireStation("003", "a3"));
return fStations;
}
public void setFStations(List<FireStation> fs){
this.fStations = fs;
}
}