EL表达式中使用三目运算符: 下面的例子的实现的功能是,如果questionType表中遍历出来的questionTypeId等于question对象中保存的questionTypeId,那么就在遍历出来的对应的questionType选项中添加selected属性。<select name=“questionTypeId”> <c:forEach items="${questionTypes }" var=“questionType”> <option value="${questionType.questionTypeId }" ${questionType.questionTypeId == question.questionType.questionTypeId ? ‘selected’ : ‘’}> ${questionType.questionTypeName } </option> <!– <option>员工手册</option> –> </c:forEach></select>EL表达式三木运算符格式:${ 要判断的条件 ? 判断结果为true时的操作 : 判断结果为false时的操作}