<select id="platformId" name="platformId">
<option value="">合作平台</option>
<option th:selected="${courseDO.platformId eq cooperationPlatformDO.id}"
th:each="cooperationPlatformDO : ${cooperationPlatformDOList}"
th:value="${cooperationPlatformDO.id}"
th:text="${cooperationPlatformDO.platformName}">
</option>
</select>
①cooperationPlatformDOList 是后台通过Model传过来的迭代对象, 也可以是List, Map, 数组等对象;
②cooperationPlatformDO 是局部变量,th:select 判断默认显示(回显的数据)