If a fragment is inserted with an unnamed parameter:
<div th:insert="::f ('hello')">...</div>
...but the fragment signature has no parameters:
<div th:fragment="f">...</div>
This could provoke some confusion, because the users could think they are passing some needed information to the fragment that the fragment is actually ignoring.
This is specially confusing in /content() scenarios that might be used to emulate a th:include using a th:insert:
In the example above, the [[${message}]] expression would print nothing, because f/content() does not match the <div th:fragment="f(message)"> tag but its contents only. And its contents contain no signature.
In these cases, therefore, an exception should be raised warning that unnamed parameters cannot be used when there is no signature at the selected fragment.
If a fragment is inserted with an unnamed parameter:
...but the fragment signature has no parameters:
This could provoke some confusion, because the users could think they are passing some needed information to the fragment that the fragment is actually ignoring.
This is specially confusing in
/content()
scenarios that might be used to emulate ath:include
using ath:insert
:In the example above, the
[[${message}]]
expression would print nothing, becausef/content()
does not match the<div th:fragment="f(message)">
tag but its contents only. And its contents contain no signature.In these cases, therefore, an exception should be raised warning that unnamed parameters cannot be used when there is no signature at the selected fragment.