title: Spring webflow URI mapping to flow ID containing slash ("/")
body: <p>We have a requirement to handle login and signup slightly differently within a subsection of our website. We need separate flows for each of the following URIs.</p>
  
  <p>/login<br>
  /signup<br>
  /subsection/login<br>
  /subsection/signup</p>
  
  <p>Our flow-registry is configured using the location pattern as in the webflow docs:</p>
  
  <pre><code>   &lt;flow:flow-registry id="flowRegistry" base-path="/WEB-INF/flow" flow-builder-services="flowBuilderServices"&gt;
        &lt;flow:flow-location-pattern value="/**/*-flow.xml" /&gt;
     &lt;/flow:flow-registry&gt;
  </code></pre>
  
  <p>And the flow XML files are in the following structure:</p>
  
  <pre><code>./root/src/main/webapp/WEB-INF/flow
  |-- subsection
  |   |-- login
  |   |   `-- subsection-login-flow.xml
  |   `-- signup
  |       `-- subsection-signup-flow.xml
  |-- login
  |   `-- login-flow.xml
  `-- signup
      `-- signup-flow.xml
  </code></pre>
  
  <p>With DEBUG logging enabled, I can see in the logs that four flows are created with the IDs "login", "signup", "subsection/login", and "subsection/signup":</p>
  
  <pre><code>24-Apr 09:21:50,887 DEBUG RMI TCP Connection(2)-127.0.0.1 definition.registry.FlowDefinitionRegistryImpl -  Registering flow definition 'ServletContext resource [/WEB-INF/flow/subsection/login/subsection-login-flow.xml]' under id 'subsection/login'   
  24-Apr 09:21:50,887 DEBUG RMI TCP Connection(2)-127.0.0.1 definition.registry.FlowDefinitionRegistryImpl -  Registering flow definition 'ServletContext resource [/WEB-INF/flow/subsection/signup/subsection-signup-flow.xml]' under id 'subsection/signup'   
  24-Apr 09:21:50,888 DEBUG RMI TCP Connection(2)-127.0.0.1 definition.registry.FlowDefinitionRegistryImpl -  Registering flow definition 'ServletContext resource [/WEB-INF/flow/login/login-flow.xml]' under id 'login'   
  24-Apr 09:21:50,889 DEBUG RMI TCP Connection(2)-127.0.0.1 definition.registry.FlowDefinitionRegistryImpl -  Registering flow definition 'ServletContext resource [/WEB-INF/flow/signup/signup-flow.xml]' under id 'signup'
  </code></pre>
  
  <p>When I go to <a href="http://mysite.com/login" rel="nofollow">http://mysite.com/login</a> or <a href="http://mysite.com/signup" rel="nofollow">http://mysite.com/signup</a>, everything works as expected.</p>
  
  <p>However, when I go to <a href="http://mysite.com/subsection/login" rel="nofollow">http://mysite.com/subsection/login</a> or <a href="http://mysite.com/subsection/signup" rel="nofollow">http://mysite.com/subsection/signup</a>, the URIs get mapped to "login" (instead of "subsection/login") or "signup" (instead of "subsection/signup"):</p>
  
  <pre><code>24-Apr 09:32:16,917 DEBUG ajp-bio-8009-exec-5 mvc.servlet.FlowHandlerMapping -  Mapping request with URI '/subsection/signup' to flow with id 'signup'
  </code></pre>
  
  <p>I traced through this in the debugger, and the DefaultFlowUrlHandler.getFlowId method is returning the flow ID based just on whatever follows the last "/", so for the URI "/subsection/signup", the flow ID returned is simply "signup".</p>
  
  <p>What am I doing wrong here? Is there any way to force the desired flow mapping?</p>
  
  <p>Thanks! </p>