我是JSF Icefaces组件的新手,我厌倦了enter link description here中针对textEntry解释的示例。当我运行它时只显示一个空白页面。我正在使用netbeans IDE并将所有必要的库正确加载到项目中。
提前致谢。
我的Jsf文件:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ace="http://www.icefaces.org/icefaces/components"
xmlns:icecore="http://www.icefaces.org/icefaces/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<ui:define name="sample">
<h:form id="textEntryForm">
<ace:panel id="personalInfoPanel" header="Personal Info">
<h:panelGrid id="inputGrid" columns="1" width="100%">
<ace:textEntry id="firstNameTxt" value="#{userBean.firstName}" labelPosition="left" required="true" requiredIndicator="(*)" indicatorPosition="right">
</ace:textEntry>
<ace:textEntry id="lastNameTxt" value="#{userBean.lastName}" labelPosition="left" required="true" requiredIndicator="(*)" indicatorPosition="right">
</ace:textEntry>
<ace:textEntry id="adds1Txt" value="#{userBean.adds1}" labelPosition="left" required="true" requiredIndicator="(*)" indicatorPosition="right">
</ace:textEntry>
<ace:textEntry id="adds2Txt" value="#{userBean.adds2}" labelPosition="left" required="true" requiredIndicator="(*)" indicatorPosition="right">
</ace:textEntry>
<ace:textEntry id="cityTxt" value="#{userBean.city}" labelPosition="left" required="true" requiredIndicator="(*)" indicatorPosition="right">
</ace:textEntry>
<ace:textEntry id="countryTxt" value="#{userBean.country}" labelPosition="left" required="true" requiredIndicator="(*)" indicatorPosition="right">
</ace:textEntry>
</h:panelGrid>
<h:panelGrid width="100%">
<ace:message id="firstNameMsg" for="firstNameTxt"/>
<ace:message id="lastNameMsg" for="lastNameTxt"/>
<ace:message id="adds1Msg" for="adds1Txt"/>
<ace:message id="adds2Msg" for="adds2Txt"/>
<ace:message id="cityMsg" for="cityTxt"/>
<ace:message id="countryMsg" for="countryTxt"/>
</h:panelGrid>
</ace:panel>
</h:form>
</ui:define>
我的Bean文件:
package sample;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@ManagedBean
@SessionScoped
public class UserBean {
private String firstName;
private String lastName;
private String adds1;
private String adds2;
private String city;
private String country;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getAdds1() {
return adds1;
}
public void setAdds1(String adds1) {
this.adds1 = adds1;
}
public String getAdds2() {
return adds2;
}
public void setAdds2(String adds2) {
this.adds2 = adds2;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
}