title: how can I take text that user write in input form thymeleaf
body: <p>I have this input form:</p>
  <pre><code>&lt;div class=&quot;searchBox&quot;&gt;
              &lt;form data-th-object=&quot;${findHotel}&quot; method=&quot;get&quot; data-th-action=&quot;@{/search}&quot;&gt;
                  &lt;input class=&quot;searchBoxTextEditor&quot; type=&quot;text&quot; placeholder=&quot;Enter name of the hotel&quot; data-th-field=&quot;*{name}&quot;&gt;
                  &lt;input type=&quot;submit&quot; value=&quot;find&quot;&gt;
              &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  <p>This form for models:</p>
  <pre><code>
  public class FindHotel {
      private String name;
  
      public FindHotel(String name) {
          this.name = name;
      }
  
      public FindHotel() {
  
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  }
  
  </code></pre>
  <p>This class controller:</p>
  <pre><code>@GetMapping(&quot;/search&quot;)
      public String getSearchRedirect(FindHotel findHotel){
          return &quot;redirect:/search/&quot; + findHotel.getName();
      }
  
  @GetMapping(&quot;/search/{text}&quot;)
  public String getSearchResultPage(@PathVariable(name = &quot;text&quot;)String text,Model model){
          List&lt;Hotel&gt; hotels = hotelService.findHotelByNameLike(text);
          model.addAttribute(&quot;hotels&quot;,hotels);
          return &quot;hotels&quot;;
  }
  
  </code></pre>
  <p>How can I change this action-url for take result without redirect <code>@GetMapping</code>. I need take result and put it in my <code>@GetMapping</code> method for take info from DB. How can I change it?</p>
  <pre><code>&lt;form data-th-object=&quot;${findHotel}&quot; method=&quot;get&quot; data-th-action=&quot;@{/search}&quot;&gt;
    &lt;input class=&quot;searchBoxTextEditor&quot; type=&quot;text&quot; placeholder=&quot;Enter name of the hotel&quot; data-th-field=&quot;*{name}&quot;&gt;
    &lt;input type=&quot;submit&quot; value=&quot;find&quot;&gt;
  &lt;/form&gt;
  </code></pre>