title: Spring MVC+JSP, get selected value from dropdown menu
body: <p>I have this page:</p>
  
  <pre><code>    &lt;form method="post" action="/monitor/admin/transferDevice/${device.deviceId}" &gt;
          &lt;input type="submit" value="Transfer Device"&gt;
      &lt;/form&gt;
  
  &lt;form:select path="users"&gt;
      &lt;option value=""&gt;Select&lt;/option&gt;
      &lt;c:forEach var="theUser" items="${users}"&gt;
          &lt;form:option value="${theUser.userId}"&gt;&lt;c:out value="${theUser.name} ${theUser.surname}"/&gt;&lt;/form:option&gt;
      &lt;/c:forEach&gt;
  &lt;/form:select&gt;
  </code></pre>
  
  <p>Where <code>users</code> is list of User objects.</p>
  
  <p>And my controller:</p>
  
  <pre><code>@RequestMapping(value = "/admin/transferDevice/{deviceId}", method = RequestMethod.POST)
  public String transferForDevice(@PathVariable("deviceId") int deviceId) throws Exception {
  
      //some logic here
  
      return "redirect:/admin";
  }
  </code></pre>
  
  <p>So the question seems very simple but not for me. How can I pass selected User to my controller method when I press the button?</p>