大量使用的JSTL标签用法

2026/4/28 3:02:51

本文并未把所有的JSTL标签罗列出来,只是写下了几个相对使用量较大的标签 1、流程控制:if,choose,when,otherwise

[html] view plaincopyprint?

1. <%@taglib prefix=%uri=\> 2. 3.

4.

5.

     

6.

7.

8.

tr>

     
9.

10.

11.

>

     
12. 13.

14.

No choice

15.
16. 17. 18.

19. red

>

20. yellow

t>

21. blue

put>

22. 23.

2、迭代:forEach 遍历集合

[html] view plaincopyprint?

1.

2. ${i} ${index} 3.

遍历Map

[html] view plaincopyprint?

1. 2. key=${m.key},value=${m.value} 3.

打印1到10

[html] view plaincopyprint?

1. 2. ${i} 3.

[html] view plaincopyprint?

1. <%@page import=\>

2. <%@taglib prefix=%uri=\> 3. <%

4. Collection students = new ArrayList();

5. students.add(new Student(\6. students.add(new Student(\7. students.add(new Student(\8. request.setAttribute(\9. %>

10.

11. 12.

13. 14. 15. 16. 17.
${stu.id}${stu.name}${stu.age}
18.

19. <%

20. Map stus = new HashMap();

21. stus.put(\22. stus.put(\23. stus.put(\24. request.setAttribute(\25. %>

26.

27. ${stu.value.id} ${stu.value.name} ${stu.value.age}
28. 29.


30.

31. ${status.count} ${status.current.name} ${status.current.age}
32. 33.


34.

35. No.${i} ${stus[i].id} ${stus[i].name} ${stus[i].age}
36. 37.


大量使用的JSTL标签用法.doc 将本文的Word文档下载到电脑
搜索更多关于: 大量使用的JSTL标签用法 的文档
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219