<c:set var="educationLevelID" value="${educationLevel.id}"/><c:forEach items="${educationLevelID}" var="enrollExamCourse">
<option value="${enrollExamCourse.id}">${enrollExamCourse.courseName}</option>
</c:forEach> 这样写只能获取educationLevelID的值,无法获得List。如果我把educationLevelID换成它的值就没问题了,就可以获取List了。这个问题也可以归结为这样:EL里没有这样的语法 ${${educationLevel.id}},那么这样的问题该怎么处理呢?
<tr>
<td>
${educationLevel.educationLevelName}
</td>
<td>
<input type="text" name="totalScore">
</td>
<td>
<c:set var="educationLevelID" value="${educationLevel.id}"/>
<select name="singleScore">
<option selected="selected" value="">请选择</option>
<c:forEach items="${educationLevelID}" var="enrollExamCourse">
<option value="${enrollExamCourse.id}">${enrollExamCourse.courseName}</option>
</c:forEach>
</select>
</td>
<td>
<input type="text" name="singleScore">
</td>
</tr>
</c:forEach>
<c:forEach items="${educationLevel.idlist}" var="enrollExamCourse">
<option value="${enrollExamCourse.id}">${enrollExamCourse.courseName}</option>
</c:forEach>
也就是在后台做下处理前台不要过多的业务逻辑处理,