JavaWeb——JSTL标签库
一、JSTL标签库
1. 基础知识
JSTL标签库全称是指JSP Standard Tag Library JSP标准标签库。是一个不断完善的开放源代码的JSP标签库。 EL表达式主要是为了替换jsp中的表达式脚本,而标签库则是为了替换代码脚本。这样使得整个jsp页面变得更佳简洁。
JSTL由五个不同功能的标签库组成。
功能范围 | URI | 前缀 |
---|---|---|
核心标签库–重点 | http://java.sun.com/jsp/jstl/core | c |
格式化 | http://java.sun.com/jsp/jstl/fmt | fmt |
函数 | http://java.sun.com/jsp/jstl/functions | fn |
数据库(不使用) | http://java.sun.com/jsp/jstl/sql | sql |
XML(不使用) | http://java.sun.com/jsp/jstl/xml | x |
2. JSTL标签库的使用步骤
- 先导入JSTL的jar包。
- 使用taglib指令引入标。

3. set标签

4. if标签

5. choose标签
6. forEach标签
7. forEach标签总结

All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.