title: Spring registration method skips body, and returns HTML
body: <p>The form in this template should create a new Person object with the given data. The submit button on the form sends a post request to the registration controller method.</p>
  <p>I am not getting any errors or exceptions, yet none of the body seems to be executed, Upon checking my database, nothing is created either. Though it does somehow return the login.html template as if a user was created.</p>
  <p><strong>Controller:</strong></p>
  <pre><code>@GetMapping(path = &quot;/register&quot;)
      public String register(Model model){
          model.addAttribute(new Person());
          return &quot;register&quot;;
      }
      @PostMapping(path = &quot;/registration&quot;)
      public String registration(@ModelAttribute @Valid Person person, BindingResult bindingResult, HttpServletRequest request){
          System.out.println(&quot;testing testing testing&quot;);
          String check = request.getParameter(&quot;passwordCheck&quot;);
          System.out.println(check);
          System.out.println(person.getPassword());
          if(bindingResult.hasErrors()){
              System.out.println(&quot;error submitting&quot;);
              System.out.println(bindingResult);
              return &quot;register&quot;;
          }
          
          service.addPerson(person, check);
          return &quot;login_page&quot;;
      }
  </code></pre>
  <p><strong>Service:</strong></p>
  <pre><code>public Person addPerson(Person person, String checker){
          
          if(checker.equals(person.getPassword())){
              String encoded_pass= passwordEncoder().encode(person.getPassword());
              person.setPassword(encoded_pass);
              return personDao.save(person);
          }
          return null;
      }
  </code></pre>
  <p><strong>Form:</strong></p>
  <pre><code>&lt;form class=&quot;col-xs-12 col-md-10 form&quot; method=&quot;post&quot; th:action=&quot;@{/registration}&quot; th:object=&quot;${person}&quot;&gt;\
  
        &lt;div class=&quot;row frm-row&quot;&gt;
          &lt;label th:for=&quot;first_name&quot; class='col-xs-4 col-md-4'&gt;First Name:&lt;/label&gt;
          &lt;input name=&quot;firstName&quot; placeholder=&quot;e.g. Jonathan&quot; th:field=&quot;*{first_name}&quot; required class='col-xs-8 col-md-8'&gt; &lt;/input&gt;
          &lt;p th:if=&quot;${#fields.hasErrors('first_name')}&quot; th:errors=&quot;*{first_name}&quot;&gt;Please Enter a valid name.&lt;/p&gt;
        &lt;/div&gt;
  
        &lt;div class=&quot;row frm-row&quot;&gt;
          &lt;label th:for=&quot;last_name&quot; class='col-xs-4 col-md-4'&gt;Last Name:&lt;/label&gt;
          &lt;input placeholder=&quot;e.g. Joestar&quot; th:field=&quot;*{last_name}&quot; class='col-xs-8 col-md-8'&gt; &lt;/input&gt;
        &lt;/div&gt;
  
        &lt;div class=&quot;row frm-row&quot;&gt;
          &lt;label th:for=&quot;email&quot; class='col-xs-4 col-md-4'&gt;Email:&lt;/label&gt;
          &lt;input name=&quot;email&quot; placeholder=&quot;e.g. Email&quot; th:field=&quot;*{email}&quot; type=&quot;email&quot; required class='col-xs-8 col-md-8'&gt; &lt;/input&gt;
          &lt;p th:if=&quot;${#fields.hasErrors('email')}&quot;&gt;Please enter a valid email, you will not be solicited.&lt;/p&gt;
        &lt;/div&gt;
  
        &lt;div class=&quot;row frm-row&quot;&gt;
          &lt;label th:for=&quot;phone&quot; class='col-xs-4 col-md-4'&gt;Phone:&lt;/label&gt;
          &lt;input placeholder=&quot;e.g. ###-###-####&quot; th:field=&quot;*{phone}&quot; class='col-xs-8 col-md-8'&gt; &lt;/input&gt;
        &lt;/div&gt;
  
        &lt;div class=&quot;row frm-row&quot;&gt;
          &lt;label th:for=&quot;username&quot; class='col-xs-4 col-md-4'&gt;Username:&lt;/label&gt;
          &lt;input name=&quot;username&quot; placeholder=&quot;e.g. Star Platinum&quot; th:field=&quot;*{username}&quot; required class='col-xs-8 col-md-8'&gt; &lt;/input&gt;
          &lt;p th:if=&quot;${#fields.hasErrors('username')}&quot; th:errors=&quot;*{username}&quot;&gt;Must be between 2 and 32 characters.&lt;/p&gt;
        &lt;/div&gt;
  
        &lt;div class=&quot;row frm-row&quot;&gt;
          &lt;label th:for=&quot;password&quot; class='col-xs-4 col-md-4'&gt;Password:&lt;/label&gt;
          &lt;input name=&quot;password&quot; type=&quot;password&quot; placeholder=&quot;********&quot; th:field=&quot;*{password}&quot; required class='col-xs-8 col-md-8'&gt;&lt;/input&gt;
          &lt;p th:if=&quot;${#fields.hasErrors('password')}&quot; th:errors=&quot;*{password}&quot;&gt;Must be between 8 and 64 characters.&lt;/p&gt;
        &lt;/div&gt;
        &lt;div class=&quot;row frm-row&quot;&gt;
          &lt;label th:for=&quot;password&quot; class='col-xs-4 col-md-4'&gt;Re-enter Password:&lt;/label&gt;
          &lt;input name=&quot;passwordCheck&quot; type=&quot;password&quot; placeholder=&quot;********&quot; required class='col-xs-8 col-md-8'&gt;&lt;/input&gt;
          &lt;p th:if=&quot;${#fields.hasErrors('password')}&quot; th:errors=&quot;*{password}&quot;&gt;Must be between 8 and 64 characters.&lt;/p&gt;
        &lt;/div&gt;
  
        &lt;div class=&quot;row frm-row-btns&quot;&gt;
          &lt;button id=&quot;sign_btn&quot; type=&quot;submit&quot;&gt;Sign Up&lt;/button&gt;
          &lt;button id=&quot;log_btn&quot; th:href=&quot;@{/login}&quot; type=&quot;button&quot;&gt;Log In&lt;/button&gt;
        &lt;/div&gt;
  
      &lt;/form&gt;
  </code></pre>