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

Locating of flow definitions broken when base-path not being used

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.5
    • Component/s: Core: Flow Executor
    • Labels:
      None

      Description

      A previously functional SWF 2.0.3 based application has stopped working after upgrading to SWF 2.0.4
      Flow definitions are no longer being found due to the change re: using flow definition path as the flow id, rather than the flow definition file name.

      <webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry">
      <webflow:flow-execution-repository max-executions="1" max-execution-snapshots="30" />
      <webflow:flow-execution-listeners>
      <webflow:listener ref="securityFlowExecutionListener" />
      </webflow:flow-execution-listeners>
      </webflow:flow-executor>

      <!-- The registry of executable flow definitions -->
      <webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices">
      <webflow:flow-location-pattern value="/WEB-INF/flow/*/.xml"/>
      </webflow:flow-registry>

      <!-- Configures the Spring Web Flow JSF integration -->
      <faces:flow-builder-services id="facesFlowBuilderServices" />

      The flow definition located at /WEB-INF/flow/login/login.xml gets stored in the flowDefinitionRegistry
      with an id of "login" in both SWF 2.0.3 and 2.0.4.

      However, when attempting to request the flow - SWF 2.0.3 looks for "login" in the registry,
      where as SWF 2.0.4 looks for "flow/login" and fails to find it.

      I believe this is due to a shift in approach to wishing to use the flow definition's path as the flow id, rather than the flow name.
      The piece of code for determining the flow id when a request comes in is DefaultFlowUrlHandler.getFlowId().

      SWF 2.0.3 implementation returns "login" as the id -

      public String getFlowId(HttpServletRequest request) {
      String pathInfo = request.getPathInfo();
      if (pathInfo != null)

      { return pathInfo.substring(1); }

      else

      { . . . }

      }

      SWF 2.0.4 implementation returns "flow/login" as the id -

      public String getFlowId(HttpServletRequest request)

      { return WebUtils.extractFilenameFromUrlPath(urlPathHelper.getLookupPathForRequest(request)); }

      As SWF 2.0.4 is a point release hopefully it shouldn't be breaking existing applications.

        Attachments

          Activity

            People

            • Assignee:
              agim Agim Emruli
              Reporter:
              nickr Nick Rountree
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1d
                1d
                Remaining:
                Remaining Estimate - 1d
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified