title: Spring WebFlow + Thymeleaf: flowExecutionKey is not present in URL
body: <p>I'm trying to integrate Spring WebFlow (SWF) into an existing Spring Boot + Thymeleaf project but am running into issues when trying to navigate away from my the first template in my flow. Specifically the URL has no flowExecutionKey parameter present, so my link which looks like:</p>
  
  <pre><code>&lt;a th:href="@{${flowExecutionUrl}(_eventId=selectPaymentMethod,type=*{paymentMethod.name})}"&gt;
    &lt;img th:src="@{|*{paymentMethod.logo}|}" class="img-thumbnail" src="../resources/images/paypal-logo.png" alt="" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>Ends up translating as a link to:</p>
  
  <pre><code>http://localhost:8080/payments/checkout-widget/session/1/checkout?_eventId=selectPaymentMethod&amp;type=Google+Checkout
  </code></pre>
  
  <p>From what I've read the flowExecutionUrl should include a flowExecutionKey parameter, something like <strong>execution=e3s2</strong>. What I instead see with the above URL is that I'm continually redirected back to the first page in my WebFlow. It's almost as if my flow isn't quite wired up correctly although I've spent a good few hours perusing similar issues on Google but can't find anybody having this exact issue. I've checked my JSESSIONID request cookie and this does not change.</p>
  
  <p>Do you know why the flowExecutionUrl is missing or null? If anymore information is needed please just ask :)</p>
  
  <p>Many thanks in advance,</p>
  
  <p>~Ian</p>
  
  <p>WebflowConfig.java:</p>
  
  <pre><code>@Configuration
  @AutoConfigureAfter(MvcConfig.class)
  public class WebflowConfig extends AbstractFlowConfiguration {
  
      @Autowired
      private SpringTemplateEngine templateEngine;
  
      @Bean
      public FlowExecutor flowExecutor() {
          return getFlowExecutorBuilder(flowRegistry())
                  .addFlowExecutionListener(new SecurityFlowExecutionListener())
                  .build();
      }
  
      @Bean
      public FlowDefinitionRegistry flowRegistry() {
          return getFlowDefinitionRegistryBuilder(flowBuilderServices())
                  .addFlowLocation("classpath:/templates/checkout.xml", "checkout")
                  .build();
      }
  
      @Bean
      public FlowBuilderServices flowBuilderServices() {
          return getFlowBuilderServicesBuilder()
                  .setViewFactoryCreator(mvcViewFactoryCreator())
                  .setDevelopmentMode(true)
                  .build();
      }
  
      @Bean
      public FlowController flowController() {
          FlowController flowController = new FlowController();
          flowController.setFlowExecutor(flowExecutor());
          return flowController;
      }
  
      @Bean
      public FlowHandlerMapping flowHandlerMapping() {
          FlowHandlerMapping flowHandlerMapping = new FlowHandlerMapping();
          flowHandlerMapping.setFlowRegistry(flowRegistry());
          flowHandlerMapping.setOrder(-1);
          return flowHandlerMapping;
      }
  
      @Bean
      public FlowHandlerAdapter flowHandlerAdapter() {
          FlowHandlerAdapter flowHandlerAdapter = new FlowHandlerAdapter();
          flowHandlerAdapter.setFlowExecutor(flowExecutor());
          flowHandlerAdapter.setSaveOutputToFlashScopeOnRedirect(true);
          return flowHandlerAdapter;
      }
  
      @Bean
      public AjaxThymeleafViewResolver thymeleafViewResolver() {
          AjaxThymeleafViewResolver viewResolver = new AjaxThymeleafViewResolver();
          viewResolver.setViewClass(FlowAjaxThymeleafView.class);
          viewResolver.setTemplateEngine(templateEngine);
          return viewResolver;
      }
  
      @Bean
      public MvcViewFactoryCreator mvcViewFactoryCreator() {
          List&lt;ViewResolver&gt; viewResolvers = new ArrayList&lt;&gt;();
          viewResolvers.add(thymeleafViewResolver());
  
          MvcViewFactoryCreator mvcViewFactoryCreator = new MvcViewFactoryCreator();
          mvcViewFactoryCreator.setViewResolvers(viewResolvers);
          mvcViewFactoryCreator.setUseSpringBeanBinding(true);
          return mvcViewFactoryCreator;
      }
  }
  </code></pre>
  
  <p>checkout.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;flow xmlns="http://www.springframework.org/schema/webflow"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/webflow
              http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"&gt;
  
      &lt;on-start&gt;
          &lt;set name="flowScope.paymentMethods" value="checkoutService.paymentMethods"/&gt;
      &lt;/on-start&gt;
  
      &lt;view-state id="payment-methods" view="payment-methods"&gt;
          &lt;transition on="selectPaymentMethod" to="new-details"/&gt;
      &lt;/view-state&gt;
  
      &lt;view-state id="new-details" view="new-details"&gt;
          &lt;transition on="submitDetails" to="summary"/&gt;
      &lt;/view-state&gt;
  
      &lt;view-state id="summary" view="summary"&gt;
          &lt;transition on="completeDetails" to="completed"/&gt;
      &lt;/view-state&gt;
  
      &lt;end-state id="cancelled" view="externalRedirect:contextRelative:/home.do"/&gt;
      &lt;end-state id="completed" view="externalRedirect:contextRelative:/home.do"/&gt;
  
      &lt;global-transitions&gt;
          &lt;transition on="cancelCheckout" to="cancelled"/&gt;
      &lt;/global-transitions&gt;
  &lt;/flow&gt;
  </code></pre>
  
  <p>WelcomeController.java:</p>
  
  <pre><code>@Controller
  @RequestMapping(value = "/payments/checkout-widget/session/{sessionId}")
  @SessionAttributes({"paymentMethods", "redirectUrls", "cardDetails"})
  public class WelcomeController {
  
      @Inject
      private CheckoutWidgetSessionService checkoutWidgetSessionService;
  
      @Inject
      private CheckoutService checkoutService;
  
      @RequestMapping(value = "/checkout", method = RequestMethod.GET)
      public String intro(
              @NotNull @PathVariable("sessionId") String sessionId,
              Model model) {
          System.out.println("Session ID:" + sessionId);
  
          model.addAttribute("paymentMethods", checkoutService.getPaymentMethods());
          model.addAttribute("deliveryAddress", checkoutService.getDeliveryAddress());
          model.addAttribute("date",new Date().toString());
  
          return "payment-methods";
      }
  }
  </code></pre>
  
  <p>payment-methods.html:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8"/&gt;
          &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"/&gt;
          &lt;meta name="viewport" content="width=device-width, initial-scale=1"/&gt;
  
          &lt;link rel="stylesheet"
                th:href="@{/css/bootstrap.min.css}"
                href="../resources/css/bootstrap.min.css"/&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div class="container"&gt;
              &lt;h1 th:text="#{payment.methods.title}"&gt;Payment Methods&lt;/h1&gt;
              &lt;br/&gt;
  
              &lt;p th:text="#{payment.methods.label}"&gt;Please select a payment method:&lt;/p&gt;
  
              &lt;div class="row"&gt;
                  &lt;div class="col-sm-2 col-xs-4 col-md-1 col-lg-1" th:each="paymentMethod : ${paymentMethods}"&gt;
                      &lt;a th:href="@{${flowExecutionUrl}(_eventId=selectPaymentMethod,type=*{paymentMethod.name})}"&gt;
                          &lt;img th:src="@{|*{paymentMethod.logo}|}" class="img-thumbnail" src="../resources/images/paypal-logo.png" alt="" /&gt;
                      &lt;/a&gt;
                  &lt;/div&gt;
  
              &lt;/div&gt;
  
          &lt;/div&gt;
          &lt;!-- jQuery (necessary for Bootstrap's JavaScript plugins) --&gt;
          &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
          &lt;!-- Include all compiled plugins (below), or include individual files as needed --&gt;
          &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"&gt;&lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>EDIT: So it would seem that WebFlow is not compliant with RESTful GET methods (i.e. when you have a dynamic part of the URL which defines the object ID). I have managed to find a work-around for my particular use-case by storing and retrieving the session ID in a different manner than with POST/GET.</p>