title: Spring boot execute 2 methods simultaneously
body: <p>I'm having a spring boot controller witch at post request executes 2 methods that return 2 lists, and those 2 lists are sent to the view page.
  Those 2 methods need like 15 seconds to run each so it would take 30-40 second for the controller to send those list into the page.How would I be able to execute those methods simultaneously and reduce time?I've tried something using threads but it didn't do anything:(</p>
  
  <pre><code>@RequestMapping(path = "search", method = RequestMethod.POST)
      public String searchPage(@ModelAttribute("specification") Specification specification, Model model) throws InterruptedException {
  
          List&lt;SearchResult1&gt; list1;
          List&lt;SearchResult2&gt; lista2;
  
          list1 = service1.search(params);
  
          list2 = service2.search(params);
  
          model.addAttribute("list1", list1);
  
          model.addAttribute("list2", list2);
  
  
          return "home";
      }
  </code></pre>