As you know, input component has an attribute, checked to whether mark the checkbox as enabled by default or not.
After digging a little, I found out the solution. There is th:checked attribute for that purpose.
This works:
This fails:
If checked="" is set to input component, it's marked checked. This method is valid for custom attributesth:attr also. Consider following example:
If flag is false, it's replaced with: