Pessoal,
tô começando a estudar JSF junto com MyFace
lendo um tutorial, fiz um menu que deveria acessar a jsp de inserção
e busca de clientes.
Só que as ações do menu não funcionam.
O código da jsp
greeting.jsp
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<f:loadBundle basename="demo.bundle.Messages" var="Message"/>
<HTML>
<HEAD> <title>Greeting Page</title> </HEAD>
<body bgcolor="white">
<f:view>
<h3>
<t:outputText value="#{Message.greeting_text}"/>
<t:outputText value="#{GetNameBean.userName}"/>
</h3>
<h:form>
<t:jscookMenu layout="hbr" theme="ThemeOffice">
<t:navigationMenuItem itemLabel="CLIENTES" icon="../images/tempo.gif">
<t:navigationMenuItem itemLabel="BUSCAR" action="buscar" icon="../images/tempo.gif" />
<t:navigationMenuItem itemLabel="INSERIR" action="inserir" icon="../images/tempo.gif" />
<t:navigationMenuItem itemLabel="RELATÓRIOS" split="true" icon="../images/tempo.gif">
<t:navigationMenuItem itemLabel="CLIENTES LICENCIADOS" action="ALGUMA_ACAO" icon="../images/tempo.gif"/>
</t:navigationMenuItem>
</t:navigationMenuItem>
<t:navigationMenuItem itemLabel="MERCADORIAS" action="ALGUMA_ACAO" icon="../images/tempo.gif" />
</t:jscookMenu>
</h:form>
</f:view>
</body>
</HTML>
faces-config.xml
<?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>
<description>Input Value Holder</description>
<managed-bean-name>GetNameBean</managed-bean-name>
<managed-bean-class>demo.GetNameBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>userName</property-name>
<property-class>java.lang.String</property-class>
<value/>
</managed-property>
</managed-bean>
<managed-bean>
<description>Agenda do usuário</description>
<managed-bean-name>agenda</managed-bean-name>
<managed-bean-class>demo.AgendaDB</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/pages/inputname.jsp</from-view-id>
<navigation-case>
<to-view-id>/pages/greeting.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/greeting.jsp</from-view-id>
<navigation-case>
<from-outcome>buscar</from-outcome>
<to-view-id>/pages/buscar.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>inserir</from-outcome>
<to-view-id>/pages/inserir.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/buscar.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/pages/buscar_ok.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>falha</from-outcome>
<to-view-id>/pages/buscar_falha.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/pages/inserir.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/pages/inserir_ok.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>falha</from-outcome>
<to-view-id>/pages/inserir_falha.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
Já tentei colocar “action” no mapeamento do greeting.jsp mas também
não funcionou.
O objetivo é quando escolher a opção do menu ir para a página desejada
Valeu pela ajuda!