title: Attempt to render model into Springboot application with Thymeleaf and Parse
body: <p>I've been following this guide <a href="http://www.thymeleaf.org/doc/articles/springmvcaccessdata.html" rel="nofollow noreferrer">http://www.thymeleaf.org/doc/articles/springmvcaccessdata.html</a> to learn how to render data models into a Springboot application with Thymeleaf. I have a function that retrieves a list of objects from my Parse-Server and renders them as model attributes:</p>
  
  <pre><code>@RequestMapping(value = "/requests", method = RequestMethod.GET)
      public String findRequestsByCurrentUser(Model model) {
  
          ParseUser currentUser = ParseUser.getCurrentUser();
          log.info(String.valueOf(currentUser.getObjectId()));
  
          findRequestsByCurrentUser(model, currentUser);
  
          return "requests";
      }    
  
  private void findRequestsByCurrentUser(Model model, ParseUser currentUser) {
              ParseQuery&lt;ParseObject&gt; requestsQuery = ParseQuery.getQuery("Request");
              requestsQuery.whereContains("author", currentUser.getObjectId());
              requestsQuery.findInBackground(new FindCallback&lt;ParseObject&gt;() {
                  @Override
                  public void done(List&lt;ParseObject&gt; requestList, ParseException e) {
                      if (e == null) {
                          model.addAttribute("requests", requestList);
                      }
                  }
              });
          }
  </code></pre>
  
  <p>Here is a debug of the model that I send to my view:</p>
  
  <p><a href="https://i.stack.imgur.com/p2nI5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p2nI5.png" alt="enter image description here"></a></p>
  
  <p>For some reason I can render <code>currentRole</code> just fine. But I can't render any of the individual attributes from the <code>requests</code> part of the mode. Should I use <code>request.data.requestStatus</code> or <code>request.requestStatus</code>? Even <code>${request}</code> alone won't render the whole object. I've tried a few different ways. None seem to work. Here is my HTML:</p>
  
  <pre><code>                &lt;center&gt;
                      &lt;table class="table table-striped"&gt;
                          &lt;tr&gt;
                              &lt;td&gt;&lt;b&gt;Requested By&lt;/b&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;b&gt;Reason&lt;/b&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;b&gt;Requested Date&lt;/b&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;b&gt;Status&lt;/b&gt;&lt;/td&gt;
                          &lt;/tr&gt;
                          &lt;tr th:each="request : ${requests}"&gt;
                              &lt;div th:switch="${request.data.requestStatus}"&gt;
                                  &lt;div th:case="Approved"&gt;
                                      &lt;td th:text="${request.author.objectId" class="initial-name"&gt;Employee Initials
                                      &lt;/td&gt;
                                      &lt;td th:text="${request.requestText}"&gt;Request Description&lt;/td&gt;
                                      &lt;td th:text="${request.dateRequested}"&gt;Request Date&lt;/td&gt;
                                      &lt;td th:switch="${request.requestStatus}"&gt;
                                      &lt;span class="red" th:case="Pending"
                                            th:text="Pending"&gt;Status&lt;/span&gt;
                                          &lt;span class="green" th:case="Approved"
                                                th:text="Approved"&gt;Status&lt;/span&gt;
                                          &lt;span class="red" th:case="Rejected"
                                                th:text="Rejected"&gt;Status&lt;/span&gt;
                                      &lt;/td&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/tr&gt;
                      &lt;/table&gt;
                  &lt;/center&gt;
  </code></pre>
  
  <p>In my HTML, I iterate over the request objects provided in requestList and then retrieve their attributes.</p>
  
  <p>Is Thymeleaf sensitive in such a way that if I have one typo anywhere in my HTML none of the objects will render? What else could be going wrong? Do I need to cast my ParseObject to a Java Object? Do I need to pass an ArrayList as opposed to a List?</p>
  
  <p>The problem seems to be in the rendering of the list itself. I removed all the attributes from the HTML and just provided static text for the list. It should have rendered 15 rows of static text but it simply doesn't render anything... I wonder what it could be.</p>