注意,不能在th:field中使用拼接
thymeleaf th:value 可以使用+号拼接两个字符串
<div class="col-sm-9">
<label th:each="brand:${brands}" class="check-box">
<input id="brands" name="brands" type="checkbox" th:value="${brand.brandId}+','+${brand.brandShortName}" th:text="${brand.brandShortName}">
</label>
</div>
另外 可以使用||符号将需要需要拼接的字符串包起来:参考地址
<div class="col-sm-9">
<label th:each="brand:${brands}" class="check-box">
<input id="brands" name="brands" type="checkbox" th:value="|${brand.brandId},${brand.brandShortName}|" th:text="${brand.brandShortName}">
</label>
</div>