1

While i create a application my page bean not saved in @FlowScoped . by default stored in Request scope here my code :

enter code here 
package com.webage.beans;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.flow.FlowScoped;

@ManagedBean(name="flow1")
@FlowScoped(value = "flow1")
public class Flow1Bean implements Serializable {

    public String cusName;
    public String city;
    public String getName() {
        return this.getClass().getSimpleName();

    }

    public String doReturnValue() {

        return "return1";
    }

    /**
     * @return the cusName
     */
    public String getCusName() {
        return cusName;
    }

    /**
     * @param cusName the cusName to set
     */
    public void setCusName(String cusName) {
        this.cusName = cusName;
    }

    /**
     * @return the city
     */
    public String getCity() {
        return city;
    }

    /**
     * @param city the city to set
     */
    public void setCity(String city) {
        this.city = city;
    }
}

My Xhtml file here i'm getting input from page and store it in page bean.:

<p>
            <span id="param1FromFlow1">Flow bean
                param1Value:<h:inputText id="input"
                    value="#{flow1.cusName}" /> </span>
        </p>

        <h:outputText value="#{null != facesContext.application.flowHandler.currentFlow}" >
        </h:outputText>

        <p></p>
        <h:commandButton type="submit" value="Next" styleClass="commandButton"
            id="button1" action="flow1a"></h:commandButton>
        <p></p>

The below code return "false" in flow/flow1.xhtml file

<h:outputText value="#{null != facesContext.application.flowHandler.currentFlow}" >
        </h:outputText>
Baskaran
  • 21
  • 1
  • 5

1 Answers1

1

Flowscope is a CDI scope. Use @Named instead of @ManagedBean.

user1643352
  • 2,635
  • 2
  • 19
  • 25