1. 程式人生 > >el表示式怎麼加foreach

el表示式怎麼加foreach

 

1

2

3

4

//下拉框(符合條件就選中) 

<c:forEach items="${psy_certificaten}" var="tt"

    <option value="${tt}" ${tt eq ext_school_psy.psy_certificaten?'selected':''}>${tt}</option> 

</c:forEach>

 

1

2

預設選中 

  <option value="1" <c:if test="${user.married eq '1'}"> selected="selected"</c:if>>已婚</option>

 

1

2

//勾選 

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

> checked="checked"</c:if>>

 

1

2

3

4

5

6

7

8

//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>