Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-1425

Cannot load flows and views from classpath correctly in SWF 2.2.1 and JSF 2

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.1
    • Fix Version/s: General Backlog
    • Component/s: JSF
    • Labels:
      None

      Description

      I tried to put the flows and views inside META-INF in the classes folder (I am trying to experiment with SWF modularity by bundling the flows and views inside JAR). Unfortunately, the Spring Web Flow (2.2.1) will fail to load a flow identified by ID if base-path contains "classpath*:". Below is the configuration:

      <webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices" base-path="classpath*:/META-INF/">
      	<webflow:flow-location id="parent-flow" path="parent-flow.xml"/>
      	<webflow:flow-location-pattern value="/**/flow.xml" />
      </webflow:flow-registry>
      

      The error message:

      org.springframework.webflow.engine.model.builder.FlowModelBuilderException: Could not access the XML flow definition at ServletContext resource [/classpath*:/META-INF/parent-flow.xml]
      

      From the example above, if i remove the parent-flow, it will throw the following error if I try to access one of the flows:

      java.lang.IllegalStateException: A ContextResource is required to get relative view paths within this context; the resource was file [/Users/wolf/Development/Workspace/webproject/target/classes/META-INF/user/user.xhtml]
      

      I have also configured RESOURCE_RESOLVER in web.xml using Jsf2FlowResourceResolver, but it didn't work. I also include the project files to simulate this issue. Thanks a lot.

      Regards,

      Donny

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pwebb Phil Webb
              Reporter:
              fenrir Donny A. Wijaya
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: