title: Thymeleaf: How to loop through a list in inverse order?
body: <p>I have a list called 'notifications' and I use Thymeleaf 'each method' to access its elements one by one. I can do this successfully as below. </p>
  
  <pre><code>&lt;li th:each="n : *{notifications}"&gt; 
      &lt;h4 type="text" th:text="*{n.message}"&gt;&lt;/h4&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>note: 'message' is the attribute I need to retrieve from the list.</p>
  
  <p>How can I access the elements in the reverse order? For an example if this is my current output,</p>
  
  <pre><code>Cat
  Dog
  Rat
  </code></pre>
  
  <p>How can I get output as this?</p>
  
  <pre><code>Rat
  Dog
  Cat
  </code></pre>