<select name="subcontractor" class="form-control m-b" required >
<option th:each="LwOrg:${LwOrgs}" th:text="${LwOrg.orgName}" th:value="${LwOrg.orgId}" th:selected="${lwPersonalInformation.subcontractor} == ${LwOrg.orgId}">
</option>
</select>
selected中用以上写法${lwPersonalInformation.subcontractor} == ${LwOrg.orgId} 获取值判断没有问题,但是不能写在一个括号里面,如:
${lwPersonalInformation.subcontractor == LwOrg.orgId}
上面的表达式会取不到值