glassfish
  1. glassfish
  2. GLASSFISH-19962

Face flows not working if the name of the start node is not same as that of the flow directory

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b80_EE7MS6
    • Fix Version/s: 4.0_b82_EE7MS7
    • Component/s: jsf
    • Labels:
      None
    • Environment:

      Glassfish b80, Mojarra 2.2.0-m11

      Description

      As the spec say, any configuration in -flow.xml file will over ride the convention, I have my flow-xml declared as follows. Here the an arbitrary name is chosen for start node and the name is mapped to the actual JSF page in the view declaration tag. When I try to use this flow,I am seing this problem : WELD-001303 No active contexts for scope type javax.faces.flow.FlowScoped

      <faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="
              http://xmlns.jcp.org/xml/ns/javaee
              http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
      
          <flow-definition id="numbers">  <!-- flow is defined in a directory
           name numbers --> 
              <flow-return id="taskFlowReturn1">
                  <from-outcome>#{numberBean.returnValue}</from-outcome>
              </flow-return>
          
              <start-node>numbers1</start-node> <!--numbers1 is an arbitrary name and mapped
       to the corresponding jsf page using the view id tag in the below line.  -->
              <view id="numbers1">
                  <vdl-document>/numbers/welcomePage.xhtml</vdl-document>
              </view>            
          
              <switch id="switch">
                  <case>
                      <if>#{numbersBean.prime}</if>
                      <from-outcome>primeNumbers</from-outcome>
                  </case>
                  <case>
                      <if>#{numbersBean.odd}</if>
                      <from-outcome>oddNumbers</from-outcome>
                  </case>
                  <case>
                      <if>#{numbersBean.even}</if>
                      <from-outcome>evenNumbers</from-outcome>
                  </case>
                  <default-outcome>index</default-outcome>
              </switch>   
          </flow-definition>
        
      </faces-config>
      
      
      

        Activity

        Hide
        Ed Burns added a comment -

        Account for case where non-Postback style navigation (such as h:link or
        h:button) is used to navigate into a flow where the start node is
        different than the flow id.

        SECTION: Modified Files
        ----------------------------
        M jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java
        M jsf-ri/src/main/java/com/sun/faces/flow/builder/MutableNavigationCase.java
        Sending jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java
        Sending jsf-ri/src/main/java/com/sun/faces/flow/builder/MutableNavigationCase.java
        Transmitting file data ..
        Committed revision 11777.

        Show
        Ed Burns added a comment - Account for case where non-Postback style navigation (such as h:link or h:button) is used to navigate into a flow where the start node is different than the flow id. SECTION: Modified Files ---------------------------- M jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java M jsf-ri/src/main/java/com/sun/faces/flow/builder/MutableNavigationCase.java Sending jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java Sending jsf-ri/src/main/java/com/sun/faces/flow/builder/MutableNavigationCase.java Transmitting file data .. Committed revision 11777.
        Hide
        Ed Burns added a comment -

        Committed to MOJARRA_2_2_0_GLASSFISH_4_0 branch.

        Port over from trunk.

        ------------------------------------------------------------------------
        r11776 | edburns | 2013-03-20 15:57:49 -0400 (Wed, 20 Mar 2013) | 81 lines

        http://java.net/jira/browse/GLASSFISH-19937

        SECTION: Modified Files
        ----------------------------
        M jsf-ri/src/main/java/com/sun/faces/config/processor/FacesFlowDefinitionConfigProcessor.java
        M jsf-ri/src/main/java/com/sun/faces/config/ConfigManager.java
        M test/web-profile/flow/pom.xml

        • Correctly implement section 11.4.3.3 of the spec, with one change to
          that section.

        M usingFacesInWebapps.fm

        • New text for 11.4.3.3:

        The following conventions apply to flows defined in this manner. Any
        flow definition in the corresponding -flow.xml file will override any
        of the conventions in the case of a conflict.

        Every vdl file in that directory is a view node of that flow.

        The start node of the flow is the view whose name is the same as the
        name of the flow.

        Navigation among any of the views in the directory is considered to be
        within the flow.

        The flow defining document id is the empty string.

        In the case of a zero length flow definition file, the following also applies:
        There is one return node in the flow, whose id is the id of the flow
        with the string "-return" (without the quotes) appended to
        it. For example, if flowId is shopping, the return node id is
        shopping-return.

        The from-outcome of the return node is a string created with the
        following formula: "/" + flowId + "-return".

        A test/web-profile/flow/basic-empty-flow-def
        A test/web-profile/flow/basic-empty-flow-def/nbactions.xml
        A test/web-profile/flow/basic-empty-flow-def/src
        A test/web-profile/flow/basic-empty-flow-def/src/test
        A test/web-profile/flow/basic-empty-flow-def/src/test/java
        A test/web-profile/flow/basic-empty-flow-def/src/test/java/com
        A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun
        A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces
        A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test
        A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile
        A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow
        A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def
        A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def/BasicEmptyFlowDefEntryExitIT.java
        A test/web-profile/flow/basic-empty-flow-def/src/main
        A test/web-profile/flow/basic-empty-flow-def/src/main/java
        A test/web-profile/flow/basic-empty-flow-def/src/main/java/com
        A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun
        A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces
        A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test
        A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile
        A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow
        A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def
        A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def/FlowBean.java
        A test/web-profile/flow/basic-empty-flow-def/src/main/resources
        A test/web-profile/flow/basic-empty-flow-def/src/main/resources/META-INF
        A test/web-profile/flow/basic-empty-flow-def/src/main/resources/META-INF/persistence.xml
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/index.xhtml
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/bounded-task-flow.xhtml
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/bounded-task-flow-flow.xml
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/next_a.xhtml
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/next_b.xhtml
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/beans.xml
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/web.xml
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/glassfish-web.xml
        A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow-return.xhtml
        A test/web-profile/flow/basic-empty-flow-def/pom.xml

        • test case content

        ------------------------------------------------------------------------
        ------------------------------------------------------------------------
        r11777 | edburns | 2013-03-20 23:10:48 -0400 (Wed, 20 Mar 2013) | 11 lines

        http://java.net/jira/browse/GLASSFISH-19962

        Account for case where non-Postback style navigation (such as h:link or
        h:button) is used to navigate into a flow where the start node is
        different than the flow id.

        SECTION: Modified Files
        ----------------------------
        M jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java
        M jsf-ri/src/main/java/com/sun/faces/flow/builder/MutableNavigationCase.java

        ------------------------------------------------------------------------
        Sending jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java
        Sending jsf-ri/src/main/java/com/sun/faces/config/ConfigManager.java
        Sending jsf-ri/src/main/java/com/sun/faces/config/processor/FacesFlowDefinitionConfigProcessor.java
        Sending jsf-ri/src/main/java/com/sun/faces/flow/builder/MutableNavigationCase.java
        Adding test/web-profile/flow/basic-empty-flow-def
        Adding test/web-profile/flow/basic-empty-flow-def/nbactions.xml
        Adding test/web-profile/flow/basic-empty-flow-def/pom.xml
        Adding test/web-profile/flow/basic-empty-flow-def/src
        Adding test/web-profile/flow/basic-empty-flow-def/src/main
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/java
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def/FlowBean.java
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/resources
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/resources/META-INF
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/resources/META-INF/persistence.xml
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/beans.xml
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/glassfish-web.xml
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/web.xml
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/bounded-task-flow-flow.xml
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/bounded-task-flow.xhtml
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/next_a.xhtml
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/next_b.xhtml
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow-return.xhtml
        Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/index.xhtml
        Adding test/web-profile/flow/basic-empty-flow-def/src/test
        Adding test/web-profile/flow/basic-empty-flow-def/src/test/java
        Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com
        Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun
        Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces
        Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test
        Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile
        Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow
        Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def
        Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def/BasicEmptyFlowDefEntryExitIT.java
        Sending test/web-profile/flow/pom.xml
        Transmitting file data ...................
        Committed revision 11791.

        Show
        Ed Burns added a comment - Committed to MOJARRA_2_2_0_GLASSFISH_4_0 branch. Port over from trunk. ------------------------------------------------------------------------ r11776 | edburns | 2013-03-20 15:57:49 -0400 (Wed, 20 Mar 2013) | 81 lines http://java.net/jira/browse/GLASSFISH-19937 SECTION: Modified Files ---------------------------- M jsf-ri/src/main/java/com/sun/faces/config/processor/FacesFlowDefinitionConfigProcessor.java M jsf-ri/src/main/java/com/sun/faces/config/ConfigManager.java M test/web-profile/flow/pom.xml Correctly implement section 11.4.3.3 of the spec, with one change to that section. M usingFacesInWebapps.fm New text for 11.4.3.3: The following conventions apply to flows defined in this manner. Any flow definition in the corresponding -flow.xml file will override any of the conventions in the case of a conflict. Every vdl file in that directory is a view node of that flow. The start node of the flow is the view whose name is the same as the name of the flow. Navigation among any of the views in the directory is considered to be within the flow. The flow defining document id is the empty string. In the case of a zero length flow definition file, the following also applies: There is one return node in the flow, whose id is the id of the flow with the string "-return" (without the quotes) appended to it. For example, if flowId is shopping, the return node id is shopping-return. The from-outcome of the return node is a string created with the following formula: "/" + flowId + "-return". A test/web-profile/flow/basic-empty-flow-def A test/web-profile/flow/basic-empty-flow-def/nbactions.xml A test/web-profile/flow/basic-empty-flow-def/src A test/web-profile/flow/basic-empty-flow-def/src/test A test/web-profile/flow/basic-empty-flow-def/src/test/java A test/web-profile/flow/basic-empty-flow-def/src/test/java/com A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def A test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def/BasicEmptyFlowDefEntryExitIT.java A test/web-profile/flow/basic-empty-flow-def/src/main A test/web-profile/flow/basic-empty-flow-def/src/main/java A test/web-profile/flow/basic-empty-flow-def/src/main/java/com A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def A test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def/FlowBean.java A test/web-profile/flow/basic-empty-flow-def/src/main/resources A test/web-profile/flow/basic-empty-flow-def/src/main/resources/META-INF A test/web-profile/flow/basic-empty-flow-def/src/main/resources/META-INF/persistence.xml A test/web-profile/flow/basic-empty-flow-def/src/main/webapp A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/index.xhtml A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/bounded-task-flow.xhtml A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/bounded-task-flow-flow.xml A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/next_a.xhtml A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/next_b.xhtml A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/beans.xml A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/web.xml A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/glassfish-web.xml A test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow-return.xhtml A test/web-profile/flow/basic-empty-flow-def/pom.xml test case content ------------------------------------------------------------------------ ------------------------------------------------------------------------ r11777 | edburns | 2013-03-20 23:10:48 -0400 (Wed, 20 Mar 2013) | 11 lines http://java.net/jira/browse/GLASSFISH-19962 Account for case where non-Postback style navigation (such as h:link or h:button) is used to navigate into a flow where the start node is different than the flow id. SECTION: Modified Files ---------------------------- M jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java M jsf-ri/src/main/java/com/sun/faces/flow/builder/MutableNavigationCase.java ------------------------------------------------------------------------ Sending jsf-ri/src/main/java/com/sun/faces/application/NavigationHandlerImpl.java Sending jsf-ri/src/main/java/com/sun/faces/config/ConfigManager.java Sending jsf-ri/src/main/java/com/sun/faces/config/processor/FacesFlowDefinitionConfigProcessor.java Sending jsf-ri/src/main/java/com/sun/faces/flow/builder/MutableNavigationCase.java Adding test/web-profile/flow/basic-empty-flow-def Adding test/web-profile/flow/basic-empty-flow-def/nbactions.xml Adding test/web-profile/flow/basic-empty-flow-def/pom.xml Adding test/web-profile/flow/basic-empty-flow-def/src Adding test/web-profile/flow/basic-empty-flow-def/src/main Adding test/web-profile/flow/basic-empty-flow-def/src/main/java Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def Adding test/web-profile/flow/basic-empty-flow-def/src/main/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def/FlowBean.java Adding test/web-profile/flow/basic-empty-flow-def/src/main/resources Adding test/web-profile/flow/basic-empty-flow-def/src/main/resources/META-INF Adding test/web-profile/flow/basic-empty-flow-def/src/main/resources/META-INF/persistence.xml Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/beans.xml Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/glassfish-web.xml Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/WEB-INF/web.xml Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/bounded-task-flow-flow.xml Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/bounded-task-flow.xhtml Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/next_a.xhtml Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow/next_b.xhtml Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/bounded-task-flow-return.xhtml Adding test/web-profile/flow/basic-empty-flow-def/src/main/webapp/index.xhtml Adding test/web-profile/flow/basic-empty-flow-def/src/test Adding test/web-profile/flow/basic-empty-flow-def/src/test/java Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def Adding test/web-profile/flow/basic-empty-flow-def/src/test/java/com/sun/faces/test/webprofile/flow/basic_empty_flow_def/BasicEmptyFlowDefEntryExitIT.java Sending test/web-profile/flow/pom.xml Transmitting file data ................... Committed revision 11791.

          People

          • Assignee:
            Ed Burns
            Reporter:
            Sreekanth
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: