I have a template :
<div th:fragment="subject">
[[${var1}]] - blabla
</div>
<div th:fragment="body">
titi
</div>
In Java :
I want to retrieve only the subject fragment and put it in a variable.
String subject = templateEngine.process(template.getPath()+" :: subject", context);
but I got the error :
java.io.FileNotFoundException: ClassLoader resource "mail/templates/mail_depot.html :: subject" could not be resolved
I can successfully call:
String subject = templateEngine.process(template.getPath(), context);
but when I add " :: subject" to only retrieve the subject fragment I got an error.