I was doing a quick review of thymeleaf and I saw this UI code snippet:
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'home')}">
After some research [https://www.thymeleaf.org/doc/tutorials/2.1/usingthymeleaf.html#parameterizable-fragment-signatures], I have a general idea but this part of the code I am not sure what it means:
~{::body},'home')
So I need a really clear explanation
It is easy to break down the structure into a hierarchy by using what thymeleaf is using as fragment selectors (One of the features of Thymeleaf Fragments is that we can grab any part of a template just using the simple selectors, through classes, ids, or simply by tags).
"~{fragments/layout :: layout (~{::body},'home')}"
::body
, the second one is basically a string valued home
.You can understand this with an example provided here in which you can find under section 5.