el表达式加foreach


//下拉框(符合条件就选中)
<c:forEach items="${psy_certificaten}" var="tt">
	<option value="${tt}" ${tt eq ext_school_psy.psy_certificaten?'selected':''}>${tt}</option>
</c:forEach>
                
默认选中
  <option value="1" <c:if test="${user.married eq '1'}"> selected="selected"</c:if>>已婚</option>

//勾选
<input type="radio"  name="user_gender" value="0"<c:if test="${user.user_gender eq '0'}"> checked="checked"</c:if>>

//for循环嵌套(列出所有,符合条件就勾选)
<c:forEach items="${good_at}" var="tt">			    
	 <input id="good_at_show" type="checkbox" value="${tt}" name="good_at_show" style="width: 3%;margin-top: 1%"
			<c:forEach items="${user_good_at}" var="aa">
				<c:if test="${aa eq tt}"> checked="checked"</c:if>
			/c:forEach>	
         >${tt}				    
</c:forEach>



猜你喜欢

转载自blog.csdn.net/qq_38880700/article/details/79454031