javax.el.PropertyNotFoundException
Я работаю над Eclipse Kepler, JSF 2.2 с библиотекой PrimeFaces 4.0 / Mojarra 2.2.
на самом деле есть 2 проблемы:
Я все еще получаю это сообщение сервера независимо от того, что я делаю.
((javax.el.PropertyNotFoundException: /Order.xhtml @ 28,76 value = "# {kk.refugee.id}": Target Unreachable, 'беженец' вернул ноль)), и если я удаляю входной текст, пульсирует скрытый, сообщение продолжает всплывать для "материала" selectOneMenu.
У меня нет шансов проверить: ((это правильный код JavaScript, чтобы скопировать значение одного компонента в другой.))
это мой файл xhtml и java calsses. спасибо в продвинутом.
kk.java
package khldqr.beans;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@SessionScoped
@ManagedBean
public class kk {
private RefugeeMan refugee;
public void AidsSpecialInsert(){
System.out.println(refugee.getId());
System.out.println(refugee.getMaterial());
System.out.println(refugee.getId2());
}
public kk() {
// TODO Auto-generated constructor stub
}
public RefugeeMan getRefugee() {
return refugee;
}
public void setRefugee(RefugeeMan refugee) {
this.refugee = refugee;
}
}
**
RefugeeMan.java
**
package khldqr.beans;
import java.io.Serializable;
public class RefugeeMan implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private int id ;
private String material;
private Integer id2;
/**
* @return the id
*/
public int getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(int id) {
this.id = id;
}
/**
* @return the material
*/
public String getMaterial() {
return material;
}
/**
* @param material the material to set
*/
public void setMaterial(String material) {
this.material = material;
}
/**
* @return the amount
*/
public RefugeeMan(){}
/**
* @return the id2
*/
public Integer getId2() {
return id2;
}
/**
* @param id2 the id2 to set
*/
public void setId2(Integer id2) {
this.id2 = id2;
}
}
**
Order.xhtml
**
<?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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Facelet Title</title>
<script type="text/javascript">
function setHiddenValue() {
document.getElementById('hidKBCardNo').value = document
.getElementById('KBCardNo').value;
return true;
}
</script>
</h:head>
<h:body>
<h:form id="frmAids" prependId="false">
<p:panel id="display" header="Sale Item" style="width: 450px;">
<p:panelGrid id="pgrid" columns="2">
<h:outputText id="outxtID" value="ID" />
<p:keyboard id="KBCardNo" value="#{kk.refugee.id}" keypadOnly="true" />
<h:outputText for="hidKBCardNo" />
<h:inputHidden id="hidKBCardNo" value="#{kk.refugee.id2}" />
<h:outputText value="material" />
<p:selectOneMenu value="#{kk.refugee.material}">
<f:selectItem itemLabel="choose one:" itemValue="" />
<f:selectItem itemLabel="Option1" itemValue="Option1" />
<f:selectItem itemLabel="Option2" itemValue="Option2" />
<f:selectItem itemLabel="Option3" itemValue="Option3" />
</p:selectOneMenu>
<p:commandButton value="Submit" onclick="setHiddenValue();"
action="#{kk.AidsSpecialInsert}" />
</p:panelGrid>
</p:panel>
</h:form>
</h:body>
</html>