Boa tarde galera
Estou trabalhando em um projeto usando JSF + Facelets + Hibernate e estou com problemas numa action de um commandbutton/commandlink. Ele simplesmente não funciona! Eu clico da um reload na pagina e não faz nada.
Segue os códigos:
Index.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:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<f:subview>
<body>
<ui:composition template="./../../templateEmb.xhtml">
<ui:define name="content">
<h:form>
<h:dataTable id="dtab" value="#{embarcadorMB.list}" var="item" border="1">
<h:column>
<f:facet name="header">
<h:outputText value="Id"></h:outputText>
</f:facet>
<h:outputText style="" value="#{item.identifier}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Peso Total"></h:outputText>
</f:facet>
<h:outputText style="" value="#{item.carga.peso}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Actions"></h:outputText>
</f:facet>
<h:commandButton action="#{embarcadorMB.setSessao}" type="submit" value="Edit">
<f:param name="solitIdentifier" value="#{item.identifier}"></f:param>
</h:commandButton>
</h:column>
</h:dataTable>
</h:form>
<br />
<br />
</ui:define>
</ui:composition>
</body>
</f:subview>
</html>
faces-config.xml (trechos)
<managed-bean>
<managed-bean-name>embarcadorMB</managed-bean-name>
<managed-bean-class>com.rplogistics.EmbarcadorMB</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-case>
<from-outcome>solitDetails</from-outcome>
<to-view-id>/embarcador/solicitacao/details.jsf</to-view-id>
<redirect />
</navigation-case>
EmbarcadorMB.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.rplogistics;
import com.rplogistics.dao.EmbarcadorDAO;
import com.rplogistics.entities.Embarcador;
import com.rplogistics.entities.Solicitacao;
import java.util.ArrayList;
import java.util.List;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
/**
*
* @author Leonardo
*/
public class EmbarcadorMB {
public EmbarcadorMB()
{
this.emb = null;
}
private Embarcador emb;
private int idSolit;
private List<Solicitacao> list;
/**
* @return the emb
*/
public Embarcador getEmb() {
if(emb == null )
{
LoginMB loginI = (LoginMB) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("userLogged");
EmbarcadorDAO dao = new EmbarcadorDAO();
this.emb = dao.getEmbarcadorID(loginI.getIdCliente());
}
return emb;
}
public List<Solicitacao> getList()
{
if(list == null)
{
list = getEmb().getSolicitacoes();
}
return list;
}
/**
* @param emb the emb to set
*/
public void setEmb(Embarcador emb) {
this.emb = emb;
}
public String setSessao()
{
SolicitacaoMB solitmb = (SolicitacaoMB) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("solicitacaoManagedBean");
HttpServletRequest req = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
idSolit = Integer.parseInt((req.getParameter("solitIdentifier")));
return solitmb.setSession(idSolit);
}
}
Debugando meu projeto, vi que ele nem chega a entrar no método setSessao().
Alguem tem alguma ideia do que pode ser este problema??
brigadão pela força desde ja! =]