How to execute java code in thymeleaf template?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to execute java code in thymeleaf template?

shukdebp2
Is it possible to add an object in Map in Thymeleaf template?
Reply | Threaded
Open this post in threaded view
|

Re: How to execute java code in thymeleaf template?

Zemi
Administrator
I think it is possible as you could invoke some arbitrary method in the expression language:

  <p th:text="${myMap.put('foo', 'bar')}">This break the 3-tier architecture</p>

but you should NOT do it.

Please take a look at
   http://en.wikipedia.org/wiki/3-tier_architecture