Help JSF faces-config.xml

Boa tarde,

Estou com o seguinte problema: estou trabalhando com jsf tenho 2 páginas:
Login e Cadastro:

A página Login tem 2 campos “usuário” e “senha”, quando eu acionar o botão confirmar da página Login eu gostaria que enviasse para a página Cadastro o nome do usuário. Estou mapeando o faces-config.xml mais não está funcionando:

OBS: estou enviando o nome usuário em um output text

Login.jsp

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
    Document   : Page1
    Created on : 19/06/2008, 14:04:10
    Author     : amgarcia
-->
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
        <html>
            <head>
                <ice:outputStyle binding="#{Login.outputStyle1}" href="./resources/stylesheet.css" id="outputStyle1"/>
                <ice:outputStyle binding="#{Login.outputStyle2}" href="./xmlhttp/css/xp/xp.css" id="outputStyle2"/>
            </head>
            <body style="-rave-layout: grid">
                <ice:form binding="#{Login.htmlForm1}" id="htmlForm1">
                    <h:inputText binding="#{Login.jtfLogin}" id="jtfLogin" style="height: 24px; left: 288px; top: 120px; position: absolute; width: 144px"/>
                    <h:commandButton action="#{Login.jbtConfirmar_action}" binding="#{Login.jbtConfirmar}" id="jbtConfirmar"
                        style="height: 24px; left: 312px; top: 216px; position: absolute; width: 72px" value="Confirmar"/>
                    <h:inputText binding="#{Login.jtfSenha}" id="jtfSenha" style="height: 24px; left: 288px; top: 168px; position: absolute; width: 144px"/>
                </ice:form>
            </body>
        </html>
    </f:view>
</jsp:root>

Login.java(Bean)

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import java.io.Serializable;

/**
 *
 * @author amgarcia
 */
public class Login implements Serializable{

    public String usuario;
    public String senha;

    public Login() {

    }

    public Login(String usuario, String senha) {
        this.usuario = usuario;
        this.senha = senha;
    }

    public String getSenha() {
        return senha;
    }

    public void setSenha(String senha) {
        this.senha = senha;
    }

    public String getUsuario() {
        return usuario;
    }

    public void setUsuario(String usuario) {
        this.usuario = usuario;
    }
}

Login.java

/*
 * Login.java
 *
 * Created on 19/06/2008, 14:04:10
 * Copyright amgarcia
 */
package AplicacaoWebForum;

import com.icesoft.faces.component.style.OutputStyle;
import com.icesoft.faces.component.ext.HtmlForm;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import javax.faces.FacesException;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.component.html.HtmlInputText;

/**
 * <p>Page bean that corresponds to a similarly named JSP page.  This
 * class contains component definitions (and initialization code) for
 * all components that you have defined on this page, as well as
 * lifecycle methods and event handlers where you may add behavior
 * to respond to incoming events.</p>
 */
public class Login extends AbstractPageBean {
    // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
    private int __placeholder;

    /**
     * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
     * This method is automatically generated, so any user-specified code inserted
     * here is subject to being replaced.</p>
     */
    private void _init() throws Exception {
    }

    private OutputStyle outputStyle1 = new OutputStyle();

    public OutputStyle getOutputStyle1() {
        return outputStyle1;
    }

    public void setOutputStyle1(OutputStyle os) {
        this.outputStyle1 = os;
    }

    private OutputStyle outputStyle2 = new OutputStyle();

    public OutputStyle getOutputStyle2() {
        return outputStyle2;
    }

    public void setOutputStyle2(OutputStyle os) {
        this.outputStyle2 = os;
    }

    private HtmlForm htmlForm1 = new HtmlForm();
    
    public HtmlForm getHtmlForm1() {
        return htmlForm1;
    }
    
    public void setHtmlForm1(HtmlForm f) {
        this.htmlForm1 = f;
    }
    private HtmlInputText jtfLogin = new HtmlInputText();

    public HtmlInputText getJtfLogin() {
        return jtfLogin;
    }

    public void setJtfLogin(HtmlInputText hit) {
        this.jtfLogin = hit;
    }
    private HtmlCommandButton jbtConfirmar = new HtmlCommandButton();

    public HtmlCommandButton getJbtConfirmar() {
        return jbtConfirmar;
    }

    public void setJbtConfirmar(HtmlCommandButton hcb) {
        this.jbtConfirmar = hcb;
    }
    private HtmlInputText jtfSenha = new HtmlInputText();

    public HtmlInputText getJtfSenha() {
        return jtfSenha;
    }

    public void setJtfSenha(HtmlInputText hit) {
        this.jtfSenha = hit;
    }

    // </editor-fold>

    /**
     * <p>Construct a new Page bean instance.</p>
     */
    public Login() {
    }

    /**
     * <p>Callback method that is called whenever a page is navigated to,
     * either directly via a URL, or indirectly via page navigation.
     * Customize this method to acquire resources that will be needed
     * for event handlers and lifecycle methods, whether or not this
     * page is performing post back processing.</p>
     * 
     * <p>Note that, if the current request is a postback, the property
     * values of the components do <strong>not</strong> represent any
     * values submitted with this request.  Instead, they represent the
     * property values that were saved for this view when it was rendered.</p>
     */
    public void init() {
        // Perform initializations inherited from our superclass
        super.init();
        // Perform application initialization that must complete
        // *before* managed components are initialized
        // TODO - add your own initialiation code here
            
        // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
        // Initialize automatically managed components
        // *Note* - this logic should NOT be modified
        try {
            _init();
        } catch (Exception e) {
            log("Page1 Initialization Failure", e);
            throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
        }
        
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        // TODO - add your own initialization code here
    }

    /**
     * <p>Callback method that is called after the component tree has been
     * restored, but before any event processing takes place.  This method
     * will <strong>only</strong> be called on a postback request that
     * is processing a form submit.  Customize this method to allocate
     * resources that will be required in your event handlers.</p>
     */
    public void preprocess() {
    }

    /**
     * <p>Callback method that is called just before rendering takes place.
     * This method will <strong>only</strong> be called for the page that
     * will actually be rendered (and not, for example, on a page that
     * handled a postback and then navigated to a different page).  Customize
     * this method to allocate resources that will be required for rendering
     * this page.</p>
     */
    public void prerender() {
    }

    /**
     * <p>Callback method that is called after rendering is completed for
     * this request, if <code>init()</code> was called (regardless of whether
     * or not this was the page that was actually rendered).  Customize this
     * method to release resources acquired in the <code>init()</code>,
     * <code>preprocess()</code>, or <code>prerender()</code> methods (or
     * acquired during execution of an event handler).</p>
     */
    public void destroy() {
    }

    public String jbtConfirmar_action() {

        bean.Login vLogin = new bean.Login("adad","12345");
        return "case1";
    }
}

Cadastro.jsp

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
    Document   : Cadastro
    Created on : 19/06/2008, 14:07:18
    Author     : amgarcia
-->
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
        <html>
            <head>
                <ice:outputStyle binding="#{Cadastro.outputStyle1}" href="./resources/stylesheet.css" id="outputStyle1"/>
                <ice:outputStyle binding="#{Cadastro.outputStyle2}" href="./xmlhttp/css/xp/xp.css" id="outputStyle2"/>
            </head>
            <body style="-rave-layout: grid">
                <ice:form binding="#{Cadastro.htmlForm1}" id="htmlForm1">
                    <h:outputText binding="#{Cadastro.jotUsuario}" id="jotUsuario"
                        style="position: absolute; left: 264px; top: 96px; width: 120px; height: 24px" value="#{logincliente.usuario}"/>
                    <h:commandButton action="#{Cadastro.button1_action}" binding="#{Cadastro.button1}" id="button1"
                        style="position: absolute; left: 336px; top: 192px" value="Submit"/>
                </ice:form>
            </body>
        </html>
    </f:view>
</jsp:root>

faces-config.xml

<?xml version='1.0' encoding='UTF-8'?>

<faces-config version="1.2" 
              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">
    <managed-bean>
        <managed-bean-name>SessionBean1</managed-bean-name>
        <managed-bean-class>AplicacaoWebForum.SessionBean1</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>Login</managed-bean-name>
        <managed-bean-class>AplicacaoWebForum.Login</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>RequestBean1</managed-bean-name>
        <managed-bean-class>AplicacaoWebForum.RequestBean1</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>ApplicationBean1</managed-bean-name>
        <managed-bean-class>AplicacaoWebForum.ApplicationBean1</managed-bean-class>
        <managed-bean-scope>application</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>Cadastro</managed-bean-name>
        <managed-bean-class>AplicacaoWebForum.Cadastro</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <managed-bean>  
        <managed-bean-name>logincliente</managed-bean-name>  
        <managed-bean-class>bean.Login</managed-bean-class>  
        <managed-bean-scope>request</managed-bean-scope>  
        <managed-property>  
            <property-name>usuario</property-name>  
            <value>#{usuario}</value>  
        </managed-property>  
    </managed-bean> 
    <navigation-rule>
        <from-view-id>/Login.jsp</from-view-id>
        <navigation-case>
            <from-outcome>case1</from-outcome>
            <to-view-id>/Cadastro.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>    
</faces-config>

Agradeço a todos.

[quote=amgarcia]Boa tarde,

Estou com o seguinte problema: estou trabalhando com jsf tenho 2 páginas:
Login e Cadastro:

A página Login tem 2 campos “usuário” e “senha”, quando eu acionar o botão confirmar da página Login eu gostaria que enviasse para a página Cadastro o nome do usuário. Estou mapeando o faces-config.xml mais não está funcionando:

OBS: estou enviando o nome usuário para um output text

Login.jsp

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
    Document   : Page1
    Created on : 19/06/2008, 14:04:10
    Author     : amgarcia
-->
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
        <html>
            <head>
                <ice:outputStyle binding="#{Login.outputStyle1}" href="./resources/stylesheet.css" id="outputStyle1"/>
                <ice:outputStyle binding="#{Login.outputStyle2}" href="./xmlhttp/css/xp/xp.css" id="outputStyle2"/>
            </head>
            <body style="-rave-layout: grid">
                <ice:form binding="#{Login.htmlForm1}" id="htmlForm1">
                    <h:inputText binding="#{Login.jtfLogin}" id="jtfLogin" style="height: 24px; left: 288px; top: 120px; position: absolute; width: 144px"/>
                    <h:commandButton action="#{Login.jbtConfirmar_action}" binding="#{Login.jbtConfirmar}" id="jbtConfirmar"
                        style="height: 24px; left: 312px; top: 216px; position: absolute; width: 72px" value="Confirmar"/>
                    <h:inputText binding="#{Login.jtfSenha}" id="jtfSenha" style="height: 24px; left: 288px; top: 168px; position: absolute; width: 144px"/>
                </ice:form>
            </body>
        </html>
    </f:view>
</jsp:root>

Login.java(Bean)

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import java.io.Serializable;

/**
 *
 * @author amgarcia
 */
public class Login implements Serializable{

    public String usuario;
    public String senha;

    public Login() {

    }

    public Login(String usuario, String senha) {
        this.usuario = usuario;
        this.senha = senha;
    }

    public String getSenha() {
        return senha;
    }

    public void setSenha(String senha) {
        this.senha = senha;
    }

    public String getUsuario() {
        return usuario;
    }

    public void setUsuario(String usuario) {
        this.usuario = usuario;
    }
}

Login.java

/*
 * Login.java
 *
 * Created on 19/06/2008, 14:04:10
 * Copyright amgarcia
 */
package AplicacaoWebForum;

import com.icesoft.faces.component.style.OutputStyle;
import com.icesoft.faces.component.ext.HtmlForm;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import javax.faces.FacesException;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.component.html.HtmlInputText;

/**
 * <p>Page bean that corresponds to a similarly named JSP page.  This
 * class contains component definitions (and initialization code) for
 * all components that you have defined on this page, as well as
 * lifecycle methods and event handlers where you may add behavior
 * to respond to incoming events.</p>
 */
public class Login extends AbstractPageBean {
    // <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
    private int __placeholder;

    /**
     * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
     * This method is automatically generated, so any user-specified code inserted
     * here is subject to being replaced.</p>
     */
    private void _init() throws Exception {
    }

    private OutputStyle outputStyle1 = new OutputStyle();

    public OutputStyle getOutputStyle1() {
        return outputStyle1;
    }

    public void setOutputStyle1(OutputStyle os) {
        this.outputStyle1 = os;
    }

    private OutputStyle outputStyle2 = new OutputStyle();

    public OutputStyle getOutputStyle2() {
        return outputStyle2;
    }

    public void setOutputStyle2(OutputStyle os) {
        this.outputStyle2 = os;
    }

    private HtmlForm htmlForm1 = new HtmlForm();
    
    public HtmlForm getHtmlForm1() {
        return htmlForm1;
    }
    
    public void setHtmlForm1(HtmlForm f) {
        this.htmlForm1 = f;
    }
    private HtmlInputText jtfLogin = new HtmlInputText();

    public HtmlInputText getJtfLogin() {
        return jtfLogin;
    }

    public void setJtfLogin(HtmlInputText hit) {
        this.jtfLogin = hit;
    }
    private HtmlCommandButton jbtConfirmar = new HtmlCommandButton();

    public HtmlCommandButton getJbtConfirmar() {
        return jbtConfirmar;
    }

    public void setJbtConfirmar(HtmlCommandButton hcb) {
        this.jbtConfirmar = hcb;
    }
    private HtmlInputText jtfSenha = new HtmlInputText();

    public HtmlInputText getJtfSenha() {
        return jtfSenha;
    }

    public void setJtfSenha(HtmlInputText hit) {
        this.jtfSenha = hit;
    }

    // </editor-fold>

    /**
     * <p>Construct a new Page bean instance.</p>
     */
    public Login() {
    }

    /**
     * <p>Callback method that is called whenever a page is navigated to,
     * either directly via a URL, or indirectly via page navigation.
     * Customize this method to acquire resources that will be needed
     * for event handlers and lifecycle methods, whether or not this
     * page is performing post back processing.</p>
     * 
     * <p>Note that, if the current request is a postback, the property
     * values of the components do <strong>not</strong> represent any
     * values submitted with this request.  Instead, they represent the
     * property values that were saved for this view when it was rendered.</p>
     */
    public void init() {
        // Perform initializations inherited from our superclass
        super.init();
        // Perform application initialization that must complete
        // *before* managed components are initialized
        // TODO - add your own initialiation code here
            
        // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
        // Initialize automatically managed components
        // *Note* - this logic should NOT be modified
        try {
            _init();
        } catch (Exception e) {
            log("Page1 Initialization Failure", e);
            throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
        }
        
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        // TODO - add your own initialization code here
    }

    /**
     * <p>Callback method that is called after the component tree has been
     * restored, but before any event processing takes place.  This method
     * will <strong>only</strong> be called on a postback request that
     * is processing a form submit.  Customize this method to allocate
     * resources that will be required in your event handlers.</p>
     */
    public void preprocess() {
    }

    /**
     * <p>Callback method that is called just before rendering takes place.
     * This method will <strong>only</strong> be called for the page that
     * will actually be rendered (and not, for example, on a page that
     * handled a postback and then navigated to a different page).  Customize
     * this method to allocate resources that will be required for rendering
     * this page.</p>
     */
    public void prerender() {
    }

    /**
     * <p>Callback method that is called after rendering is completed for
     * this request, if <code>init()</code> was called (regardless of whether
     * or not this was the page that was actually rendered).  Customize this
     * method to release resources acquired in the <code>init()</code>,
     * <code>preprocess()</code>, or <code>prerender()</code> methods (or
     * acquired during execution of an event handler).</p>
     */
    public void destroy() {
    }

    public String jbtConfirmar_action() {

        bean.Login vLogin = new bean.Login("adad","12345");
        return "case1";
    }
}

Cadastro.jsp

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
    Document   : Cadastro
    Created on : 19/06/2008, 14:07:18
    Author     : amgarcia
-->
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:jsp="http://java.sun.com/JSP/Page">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
        <html>
            <head>
                <ice:outputStyle binding="#{Cadastro.outputStyle1}" href="./resources/stylesheet.css" id="outputStyle1"/>
                <ice:outputStyle binding="#{Cadastro.outputStyle2}" href="./xmlhttp/css/xp/xp.css" id="outputStyle2"/>
            </head>
            <body style="-rave-layout: grid">
                <ice:form binding="#{Cadastro.htmlForm1}" id="htmlForm1">
                    <h:outputText binding="#{Cadastro.jotUsuario}" id="jotUsuario"
                        style="position: absolute; left: 264px; top: 96px; width: 120px; height: 24px" value="#{logincliente.usuario}"/>
                    <h:commandButton action="#{Cadastro.button1_action}" binding="#{Cadastro.button1}" id="button1"
                        style="position: absolute; left: 336px; top: 192px" value="Submit"/>
                </ice:form>
            </body>
        </html>
    </f:view>
</jsp:root>

faces-config.xml

<?xml version='1.0' encoding='UTF-8'?>

<faces-config version="1.2" 
              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">
    <managed-bean>
        <managed-bean-name>SessionBean1</managed-bean-name>
        <managed-bean-class>AplicacaoWebForum.SessionBean1</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>Login</managed-bean-name>
        <managed-bean-class>AplicacaoWebForum.Login</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>RequestBean1</managed-bean-name>
        <managed-bean-class>AplicacaoWebForum.RequestBean1</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>ApplicationBean1</managed-bean-name>
        <managed-bean-class>AplicacaoWebForum.ApplicationBean1</managed-bean-class>
        <managed-bean-scope>application</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>Cadastro</managed-bean-name>
        <managed-bean-class>AplicacaoWebForum.Cadastro</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <managed-bean>  
        <managed-bean-name>logincliente</managed-bean-name>  
        <managed-bean-class>bean.Login</managed-bean-class>  
        <managed-bean-scope>request</managed-bean-scope>  
        <managed-property>  
            <property-name>usuario</property-name>  
            <value>#{usuario}</value>  
        </managed-property>  
    </managed-bean> 
    <navigation-rule>
        <from-view-id>/Login.jsp</from-view-id>
        <navigation-case>
            <from-outcome>case1</from-outcome>
            <to-view-id>/Cadastro.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>    
</faces-config>

Agradeço a todos.[/quote]

O problema foi resolvido, eu não estava setando o valor certo no managed-bean.