title: Thymeleaf + Spring how to pass to a controller a @PathVariable from a form select option value
body: <p>I would like to use a select box to redirect to an URL containing the select value.</p>
  
  <p>Here bellow the HTML page with thymeleaf variables :</p>
  
  <pre><code>&lt;form th:action="@{/app/}"&gt;
      &lt;select id="app" name="app"&gt;
          &lt;option th:each="app : ${apps}"
              th:value="${app.id}"
              th:text ="${app.name}"&gt;
          &lt;/option&gt;
      &lt;/select&gt;
      &lt;button&gt;Go&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The controller is written as following :</p>
  
  <pre><code>@RequestMapping("/app/{appId}")
  public ModelAndView getApp(@PathVariable String appId){...}
  </code></pre>
  
  <p>My goal is to access the controller with the URL : <code>mydomain/app/{app.id}/</code>
  I tried to use <code>th:field</code> onto the select without success. I'm missing something here.</p>
  
  <p>Please, could you explain me how to add the select value to the URL expected by the controller ?</p>
  
  <p>Thank you for the hints</p>
  
  <p><strong>EDIT following @NicolaiEhemann answer</strong></p>
  
  <p>I moved to javascript using jquery and ajax :</p>
  
  <pre><code>$('button').click(function() {
      $.ajax({
          url: '/app/' + $('#app').val(),
          dataType: 'html'
      }).done(function(data) {
          $('#result').html(data)
      });
  });
  </code></pre>
  
  <p>Thank you.</p>