title: Thymeleaf fragment logic
body: <p>So I try to create a simple page layout for my spring app, just a header and a content. 
  Generally it is not really complicated, I can create a header fragment, insert in in any of the views and it works just fine. </p>
  
  <p>Now I would like to add avatar and user name in the header. The first thing I can think of is creating a code which will handle this header logic, somehow fetching the user and putting it in the model so that it can be properly processed by thymeleaf. </p>
  
  <p>Any way to do it? I mean is there a way to include a fragment in views but not calling any functions manually in the respective controllers (to fetch user, or generally to do the logic of a fragment)? </p>
  
  <p>edit: basically I would like to do equivalent of angular directive. </p>