title: Invoke method when Dropdown value selected in SpringBoot Thymeleaf
body: <p>I can able to invoke the method when submit the button.But I need to invoke method when drop down value selected from drop down list in SpringBoot.</p>
  
  <p>I tried using below but didn't worked. </p>
  
  <p>Please find the sample code as shown below:</p>
  
  <pre><code>&lt;select th:field="*{country}" xmlns:th="th"&gt;
     &lt;option value=""&gt;Select&lt;/option&gt;
     &lt;option value="first"&gt;1&lt;/option&gt;
     &lt;option value="second"&gt;2&lt;/option&gt;
     &lt;option value="third"&gt;3&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Java code:</p>
  
  <pre><code>@Controller
  public class Countries() {
  
    @GetMapping(value = "/")
      public String menu(ModelMap model) {
  
          model.addAttribute("createMenu", new Country());
  
          return "menu";
      }
  
    @RequestMapping("/first")
      public List&lt;Object&gt; country(){
  
          System.out.println("first");
  
          return null;
  
      }
   }
  </code></pre>
  
  <p>When selected dropdown value then invoke method to get list of states.Can anyone please help me on this.</p>