title: How session attributes can be access by Thymeleaf
body: <p>I've tryed to access the variable in this way: </p>
  
  <pre><code>&lt;p th:text="${#session.getAttribute('mySessionAttribute')}"&gt;&lt;/p&gt;
  
  @RequestMapping({"/"})
  String index(HttpSession session) {
      session.setAttribute("mySessionAttribute", "someValue");
      return "index";
  }
  </code></pre>
  
  <p>The documentation says: #session : direct access to the javax.servlet.http.HttpSession object associated with the current request.</p>
  
  <p>I'm using Tomcat 8, Java 8, Spring Boot and Thymeleaf.</p>