As you know, input component has an attribute, checked to whether mark the checkbox as enabled by default or not.
input
checked
Neither suggested solutions worked for me.
This one worked:
th:checked="${#strings.equals(param.myRequestParameterXYZ, 'foobar')}"