我正在開發與primefaces的應用程序,我正嘗試繪製自己的狀態與我的用戶的Bean的,但我不能結合豆,這是我的代碼:Primefaces與形式
<h:form>
<p:panelGrid columns="2">
<h:outputLabel for="usuario" value="Usuario: *"/>
<h:inputText id="usuario" binding="#{beanPrueba.user.usuario}"></h:inputText>
<h:outputLabel for="contrasena" value="Contraseña: *" />
<h:inputSecret id="contrasena"></h:inputSecret>
<f:facet name="footer">
<p:commandButton icon="ui-icon-check" value="Entrar" ajax="false"
action="#{beanPrueba.prueba()}"/>
</f:facet>
</p:panelGrid>
</h:form>
支持bean :
@ManagedBean(name = "beanPrueba")
@SessionScoped
public class BeanLogin {
private Usuario user = new Usuario();
public Usuario getUser() {
return user;
}
public void setUser(Usuario user) {
this.user = user;
}
public void prueba()
{
try {
//my code
}
catch(Exception ex)
{
System.out.print(ex.getMessage());
}
}
在我的豆
聲明用戶的對象,我使用我的地圖形式與我的bean對象用戶但當地圖與我的form bean
你會得到什麼錯誤? – 2013-02-13 04:24:20