title: Thymleaf Spring MVC Button executes Java method
body: <p>So this is what I have in my HTML file:</p>
  
  <pre><code>&lt;ul&gt;
      &lt;th:block th:object="${Post}"&gt;
          &lt;li class="post" th:each="Post : ${Posts}"&gt;
              &lt;p  th:text ="${Post.getPostText()}"&gt;&lt;/p&gt;
              &lt;button th:onclick = "${Post.upvote()}"&gt;Upvote&lt;/button&gt;
              &lt;button th:onclick = "${Post.downvote()}"&gt;Downvote&lt;/button&gt;
              &lt;p th:text = "${Post.getPostVotes()}"&gt;&lt;/p&gt;
          &lt;/li&gt;
      &lt;/th:block&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I want the button to execute a method within the Post class. I'm not sure if I'm using the correct Thymeleaf 'tag'. Right now, when the page loads, it executes the post upvote and downvote methods. 
  Can anyone help out? I have a feeling I'm using the wrong Thymeleaf Tag. </p>