Peguei um tutoriual sobre Myfaces, instalei e tudo, aparentemente, funciona perfeitamente.
Montei um Menu usando JSF, mas quando clico sobre a opção desejada ele não acessa a outra página.
Vejam
[code]package sigecon;
import java.util.ArrayList;
import org.apache.myfaces.custom.navmenu.NavigationMenuItem;
public class Menu {
private NavigationMenuItem[] navItems;
public Menu() {
// Criando os Menus Raizes
NavigationMenuItem primeiroMenu = new NavigationMenuItem("Cadastro",null, "/img/cadastro.gif", false);
// Agora acrescentando os menus raÃzes ao array que será retornado ao
// JSP
this.navItems = new NavigationMenuItem[1];
this.navItems[0] = primeiroMenu;
// Agora acrescentando os itens no menu primeiroMenu
ArrayList subItensPrimeiroMenu = new ArrayList();
subItensPrimeiroMenu.add(new NavigationMenuItem("Contrato", "CadastroContratoInicial", "/img/cadastro.gif", false));
primeiroMenu.setNavigationMenuItems(subItensPrimeiroMenu);
}
public NavigationMenuItem[] getNavItems() {
return navItems;
}
public void setNavItems(NavigationMenuItem[] navItems) {
this.navItems = navItems;
}
}
[/code]
[code]<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<managed-bean>
<managed-bean-name>menu</managed-bean-name>
<managed-bean-class>sigecon.Menu</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>menuSecretaria</managed-bean-name>
<managed-bean-class>sigecon.MenuSecretaria</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<navigation-case>
<from-outcome>CadastroContratoInicial</from-outcome>
<to-view-id> /pri/pri_CadastroContratoInicial.jsp </to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>ConsultaContrato</from-outcome>
<to-view-id>/pri/pri_ConsultaContrato.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
[/code]
[/url]