title: How to get input values from spring boot thyme leaf to java class?
body: <p>I am trying to get a value from thymeleaf <code>input</code> into my java class.</p>
  
  <p>Simple script from thymeleaf:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input type="text" id="datePlanted" name="datePlanted" th:value="*{datePlanted}"/&gt;
  </code></pre>
  
  <p>How would I be able to retrieve <code>datPlanted</code> into my java class?</p>
  
  <p>Attempted the following servlet tutorial:</p>
  
  <pre><code>@WebServlet("/")
  public class LoginServlet extends HttpServlet {
  
      protected void doPost(HttpServletRequest request,
                            HttpServletResponse response) throws ServletException, IOException {
          // read form fields
          String username = request.getParameter("datePlanted");
  
          System.out.println("date: " + datePlanted);
  
          // do some processing here...
          // get response writer
          PrintWriter writer = response.getWriter();
          // return response
          writer.println(htmlRespone);
      }
  }
  </code></pre>
  
  <p>I tried to follow a tutorial but I am not sure that I should/should not be using servlets. My Application is created with Spring Boot, Java, and Thymeleaf. What am I doing wrong? I am open to other options, I am trying to understand and learn how to solve this problem.</p>