Pessoal, estou precisando muito de um help… estou fazendo um projeto em JSF e nada de dar certo o meu menu, assim:
construi as paginas e os backings e o faces-config, mas agora não consigo fazer com que o mesmo reconheça os caminhos
a estrutura está normal, isso eu verifiquei, não sei se preciso fazer um onclick nos action="#{menu.irEmpresa}",
se alguem poder dar uma ajuda agradeço muito … desde já Valeu mesmo … segue parte do meu codgo do menu…
até
Então . estou fazendo em modulos… tentanto com que funcione pelo menos uma parte pra depois arrumar as outras
menuInc.jsp
<!--Chamada ao arquivo CSS -->
<link rel="StyleSheet" type="text/css" href="estilos.css" rel = 'stylesheet' media="screen" >
</head>
<h:form>
<h:panelGrid columns="1" cellspacing="0" cellpadding="0" border="2">
<rich:paint2D style="width:105px">
<rich:dropDownMenu style="border:1px solid #{a4jSkin.panelBorderColor}" value="HOME" submitMode="none" direction="bottom-right" jointPoint="tr" styleClass="menu">
</rich:dropDownMenu>
<rich:dropDownMenu style="border:1px solid #{a4jSkin.panelBorderColor}" value="CADASTROS" submitMode="none" direction="bottom-right" jointPoint="tr" styleClass="menu">
<rich:menuItem value="EMPRESA" action="#{menu.irEmpresa}" styleClass="menu"/>
<rich:menuItem value="USUARIO" action="#{menu.irUsuario}" styleClass="menu"/>
<rich:menuItem value="RIOS" action="#{menu.irRios}" styleClass="menu"/>
<rich:menuItem value="POLUENTE" action="#{menu.irPoluentes}" styleClass="menu"/>
</rich:dropDownMenu>
incluirEmpresa.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Cadastro de Empresas</title>
<!--Chamada ao arquivo CSS -->
<link rel="StyleSheet" type="text/css" href="estilos.css" rel = 'stylesheet' media="screen" >
</head>
<f:view>
<div id="geral">
<h:panelGrid columns="1" cellspacing="0" cellpadding="0" border="2" width="61%" columnClasses="outergridvalidationcolumn">
<h:form>
<jsp:include page="/pages/menu/topo.jsp"></jsp:include>
</h:form>
<h:panelGrid columns="2" cellspacing="0" cellpadding="0" border="2" width="61%">
<h:form>
<jsp:include page="/pages/menu/menuInc.jsp"></jsp:include>
</h:form>
<h:form>
<rich:panel style="width:650px">
<fieldset>
<legend >Dados da Empresa</legend>
<!--Tag JSF, com o atributo styleClass referenciado o seletor CSS específico -->
<h:outputText value="RAZAO SOCIAL:" styleClass="rotulos"/><br>
<h:inputText id="empreRazaoSocial" value="" styleClass="edit" maxlength="70" size="90" /><br>
<h:outputText value="NOME FANTASIA:" styleClass="rotulos"/><br>
faces-config
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
<application>
<locale-config>
<default-locale>pt_BR</default-locale>
</locale-config>
</application>
<!-- Registro dos backing bean -->
<managed-bean>
<managed-bean-name>login</managed-bean-name>
<managed-bean-class>backing.LoginBacking</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>menu</managed-bean-name>
<managed-bean-class>backing.MenuBacking</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>empresa</managed-bean-name>
<managed-bean-class> backing.EmpresaBacking </managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>listagem</managed-bean-name>
<managed-bean-class> backing.ListagemBacking </managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<!-- Regras de navegação global -->
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>empresa</from-outcome>
<to-view-id>/pages/empresa/incluirEmpresa.jsp </to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>listagem</from-outcome>
<to-view-id>/pages/listagem/incluirListagem.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>login</from-outcome>
<to-view-id>/pages/login/login.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>menuPrincipal</from-outcome>
<to-view-id>/pages/menu/menu.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>usuario</from-outcome>
<to-view-id>/pages/usuario/incluirUsuario.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<!-- Regras de navegação local -->
<navigation-rule>
<from-view-id>/pages/login/login.jsp</from-view-id>
<navigation-case>
<from-outcome>sicep</from-outcome>
<to-view-id>/pages/menu/menu.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/menu/menu.jsp</from-view-id>
<navigation-case>
<from-outcome>empresa</from-outcome>
<to-view-id> /pages/empresa/incluirEmpresa.jsp </to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/empresa/incluirEmpresa.jsp </from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/pages/empresa/incluirEmpresa.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>buscar</from-outcome>
<to-view-id>/pages/empresa/buscarEmpresa.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/empresa/buscarEmpresa.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/pages/empresa/buscarEmpresa.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>falha</from-outcome>
<to-view-id>/pages/empresa/incluirEmpresa.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>editar</from-outcome>
<to-view-id>/pages/empresa/editarEmpresa.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>excluir</from-outcome>
<to-view-id>/pages/empresa/excluirEmpresa.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/empresa/excluirEmpresa.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/pages/empresa/buscarEmpresa.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>falha</from-outcome>
<to-view-id>/pages/empresa/buscarEmpresa.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/laboratorio/editarLaboratorio.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/pages/laboratorio/buscarLaboratorio.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>falha</from-outcome>
<to-view-id>/pages/empresa/buscarEmpresa.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/listagem/incluirListagem.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/pages/listagem/incluirListagem.jsp </to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>buscar</from-outcome>
<to-view-id>/pages/listagem/buscarListagem.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/listagem/buscarListagem.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/pages/listagem/buscarListagem.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>falha</from-outcome>
<to-view-id>/pages/listagem/incluirListagem.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>editar</from-outcome>
<to-view-id>/pages/listagem/editarListagem.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>excluir</from-outcome>
<to-view-id>/pages/listagem/excluirListagem.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/listagem/excluirListagem.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/pages/listagem/buscarListagem.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>falha</from-outcome>
<to-view-id>/pages/listagem/buscarListagem.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/listagem/editarListagem.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/pages/listagem/buscarListagem.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>falha</from-outcome>
<to-view-id>/pages/listagem/buscarListagem.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
menuBacking.java
package backing;
import util.JSFUtil;
public class MenuBacking {
public String irEmpresa(){
return JSFUtil.EMPRESA;
}
public String irMenuPrincipal(){
return JSFUtil.MENU_PRINCIPAL;
}
public String irLogin(){
return JSFUtil.LOGIN;
}
}
JSFUtil.java
package util;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
public class JSFUtil {
public static final String FALHA = "falha";
public static final String SUCESSO = "sucesso";
public static final String BUSCAR = "buscar";
public static final String EDITAR = "editar";
public static final String EXCLUIR = "excluir";
public static final String EMPRESA = "empresa";
public static final String POLUENTE = "poluente";
public static final String LOGIN = "login";
public static final String MENU_PRINCIPAL = "menuPrincipal";
public static final String PRODUTO = "produto";
public static void addGlobalMessage(String msg) {
// Cria a mensagem
FacesMessage facesMessage = new FacesMessage(
FacesMessage.SEVERITY_INFO, msg, msg);
// Captura o contexto
FacesContext facesContext = FacesContext.getCurrentInstance();
// Adiciona a mensagem ao contexto
facesContext.addMessage(msg, facesMessage);
}
public static void addErrorMessage(String msg) {
// Cria a mensagem
FacesMessage facesMessage = new FacesMessage(
FacesMessage.SEVERITY_ERROR, msg, msg);
// Captura o contexto
FacesContext facesContext = FacesContext.getCurrentInstance();
// Adiciona a mensagem ao contexto
facesContext.addMessage(msg, facesMessage);
}
}