jstl是第三方的标签库。
如果在不使用框架的前提下,可以用jstl组件完成相关的操作。
要在Tomcat中安装JSTL,有下面三个步骤:
- 拷贝JSTL中的lib上当下的 JAR文件到Tomcat的lib目录中.
- 拷贝JSTL TLD文件到Tomcat的web-inf目录中
- 修改web.xml文件包含这些TLD文件。
<jsp-config>
<taglib>
<taglib-uri>http://www.mldn.cn/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://www.mldn.cn/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://www.mldn.cn/jstl/fn</taglib-uri>
<taglib-location>/WEB-INF/fn.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://www.mldn.cn/jstl/sql</taglib-uri>
<taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://www.mldn.cn/jstl/x</taglib-uri>
<taglib-location>/WEB-INF/x.tld</taglib-location>
</taglib></jsp-config>
最核心最重要的是的是<c: >标签,也是用的最多的。可以完成输出、判断、迭代等。。。