学习内容:
el 表达式
forEach for的用法
choose when otherwise switch的用法
学习时间:
提示:这里可以添加计划学习的时间
例如:
1、 周一至周五晚上 7 点—晚上9点
2、 周六上午 9 点-上午 11 点
3、 周日下午 3 点-下午 6 点
学习产出:
items获取对象集合
var获取对象
varStatuc获取对象信息
for (user u : list) {
u 相当于 var = “user”,获取每次遍历的对象
list 相当于 items=“list” 遍历的集合
}
<c:forEach items="
l
i
s
t
"
v
a
r
=
"
u
s
e
r
"
v
a
r
S
t
a
t
u
s
=
"
s
t
a
t
u
s
"
>
<
t
r
>
<
t
d
>
{list}" var="user" varStatus="status"> <tr> <td>
list"var="user"varStatus="status"><tr><td>{status.count}
u
s
e
r
.
u
s
e
r
n
a
m
e
<
/
t
d
>
<
t
d
>
<
c
:
c
h
o
o
s
e
>
<
c
:
w
h
e
n
t
e
s
t
=
"
{user.username}</td> <td> <c:choose> <c:when test="
user.username</td><td><c:choose><c:whentest="{user.usersex == 1}">
男
</c:when>
<c:otherwise>
女
</c:otherwise>
</c:choose>
u
s
e
r
.
p
h
o
n
e
n
u
m
b
e
r
<
/
t
d
>
<
t
d
>
{user.phonenumber}</td> <td>
user.phonenumber</td><td>{user.qqnumber}
</c:forEach>