title: Spring form th:object and th:field
body: <p>I would like to capture just the input name to the spieler object.</p>
  <pre><code>&lt;form th:action=&quot;@{/login}&quot; method=&quot;post&quot; th:object=&quot;${spieler}&quot;&gt;
       &lt;label for=&quot;nameInput&quot; class=&quot;mt-4&quot;&gt;Tragen einfach deinen Name ein, um deine Reise zu beginnen :&lt;/label&gt;
       &lt;br&gt;
       &lt;div class=&quot;d-flex justify-content-center my-4&quot; &gt;
            &lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;nameInput&quot; th:field=&quot;*{name}&quot;&gt;
            &lt;button type=&quot;submit&quot; class=&quot;btn-secondary &quot;&gt;Beginnen&lt;/button&gt;
       &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  <p>this is the controller</p>
  <pre><code>@PostMapping(&quot;/login&quot;)
  public String login (@ModelAttribute(&quot;spieler&quot;) Spieler spieler){
      spielerRepository.save(spieler);
      return &quot;redirect:/&quot;;
  }
  </code></pre>
  <p>and the Spieler-class:</p>
  <pre><code>@Data
  public class Spieler {
       private int id;
       private String name;
       private int level;
       private int punkte;
  
       public Spieler (String name){
          this.name = name;
          this.level = 1;
          this.punkte = 0;
       }
  }
  </code></pre>
  <p>the thymeleaf don't do that. How can i please solve this problem ?
  Sorry for bad English !</p>