title: How to set variables in a thymeleaf fragment?
body: <p>I understand Thymeleaf is made for rendering the views however, I just wanted to know if there is any way to set a variable may be in request scope in a Thymeleaf fragment?</p>
  
  <p>I have a very large conditional expression that I have to repeat a lot of times across the application so it will be really helpful if I can set a variable in main layout then reuse it in all other child fragments.</p>
  
  <p>I am aware of using a Spring interceptor and setting the variable in model but I prefer not to.</p>
  
  <p>Please advise.</p>
  
  <p>Thanks</p>
  
  <p>Prash</p>