Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse org.jboss.weld.context.contextNotActivieException:weld-001303作用域类型javax.faces.flow.FlowScoped没有活动上下文_Eclipse_Jsf_Flow Scope - Fatal编程技术网

Eclipse org.jboss.weld.context.contextNotActivieException:weld-001303作用域类型javax.faces.flow.FlowScoped没有活动上下文

Eclipse org.jboss.weld.context.contextNotActivieException:weld-001303作用域类型javax.faces.flow.FlowScoped没有活动上下文,eclipse,jsf,flow-scope,Eclipse,Jsf,Flow Scope,我试图开发一个JSF2.2新功能的简单示例,@FlowScope,我用EclipseLuna和glassfish 4.0开发它,我想代码是正确的,因为我在web上看到了它,可能错误在于项目的配置。谁能告诉我可能发生什么事?如果这些信息很难理解,请询问我更多的信息,但实际上我不知道还能写些什么来帮助我,这是我关于stackoverflow的第一个问题 public class NestedFlowBuilder implements Serializable { private stat

我试图开发一个JSF2.2新功能的简单示例,@FlowScope,我用EclipseLuna和glassfish 4.0开发它,我想代码是正确的,因为我在web上看到了它,可能错误在于项目的配置。谁能告诉我可能发生什么事?如果这些信息很难理解,请询问我更多的信息,但实际上我不知道还能写些什么来帮助我,这是我关于stackoverflow的第一个问题

public class NestedFlowBuilder implements Serializable {

    private static final long serialVersionUID = 1L;    
    @Produces
    @FlowDefinition
    public Flow defineCallingFlow
    (@FlowBuilderParameter FlowBuilder flowBuilder) {
    String flowId = "secondJavaFlow";
    flowBuilder.id("", flowId);
    flowBuilder.viewNode(flowId, "/java-calling-flow/start-page.xhtml")
    .markAsStartNode();
    flowBuilder.viewNode("results", 
    "/java-calling-flow/results-page.xhtml");
    flowBuilder.returnNode("return").fromOutcome("/return-page-for-java-calling-flow");   
    flowBuilder.returnNode("home").fromOutcome("/index");
    flowBuilder.flowCallNode("go-to-nested")
    .flowReference("", "thirdJavaFlow")
    .outboundParameter("paramForNestedFlow", 
    "#{javaCallingFlowBean.param1}");
    return(flowBuilder.getFlow());
    }



    @Produces
    @FlowDefinition
    public Flow defineNestedFlow
    (@FlowBuilderParameter FlowBuilder flowBuilder) {
    String flowId = "thirdJavaFlow";
    flowBuilder.id("", flowId);
    flowBuilder.viewNode(flowId, 
    "/java-nested-flow/start-page.xhtml")
    .markAsStartNode();
    flowBuilder.viewNode("results", 
    "/java-nested-flow/results-page.xhtml");
    flowBuilder.returnNode("return-to-previous-start")
    .fromOutcome("secondJavaFlow"); 
    flowBuilder.returnNode("return-to-previous-results")
    .fromOutcome("results");
    flowBuilder.inboundParameter("paramForNestedFlow", 
    "#{javaNestedFlowBean.param3}");
    return(flowBuilder.getFlow());
    }

package coreservlets;

import java.io.Serializable;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.flow.FlowScoped;
import javax.inject.Named;


@Named
@FlowScoped("thirdJavaFlow")
public class JavaNestedFlowBean implements Serializable {

    private static final long serialVersionUID = 1L;
    private String param3, param4;

    public String doFlow() {
    if (param3.equalsIgnoreCase(param4)) {
    FacesContext context = FacesContext.getCurrentInstance();
    FacesMessage fMessage = 
    new FacesMessage("Params must be distinct");
    fMessage.setSeverity(FacesMessage.SEVERITY_ERROR);
    context.addMessage(null, fMessage);
    return(null);
    } else {
    return("results");
    }
    }

    public String getParam3() {
        return param3;
    }
    public void setParam3(String param3) {
        this.param3 = param3;
    }

    public String getParam4() {
        return param4;
    }

    public void setParam4(String param4) {
        this.param4 = param4;
    }

    public static long getSerialversionuid() {
        return serialVersionUID;
    }
    }

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Java Calling Flow Start PAge</title>
</head>
<body>
<h:form>
<h:messages globalOnly="true" styleClass="error"/>
<h:panelGrid columns="3" styleClass="formTable">
Param 1: 
<h:inputText value="#{javaCallingFlowBean.param1}" id="param1"
required="true"
requiredMessage="Param 1 is required"/>
<h:message for="param1" styleClass="error"/>
Param 2: 
<h:inputText value="#{javaCallingFlowBean.param2}" id="param2"
required="true"
requiredMessage="Param 2 is required"/>
<h:message for="param2" styleClass="error"/>
<f:facet name="footer">
<h:commandButton value="Show Results"
action="#{javaCallingFlowBean.doFlow}"/><br/>
</f:facet>
</h:panelGrid>
</h:form>
</body>
</html>

从第33页

可能会发布您从第33页获得代码的链接谢谢
javax.el.ELException: /java-calling-flow/start-page.xhtml @17,40 value="#{javaCallingFlowBean.param1}": org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.faces.flow.FlowScoped