一.JSTL库
导入standard.jar、jstl.jar两个jar包
二.tld配置
非自动加载方式
(1)拷贝tld文件
将tld文件拷到WEB-INF的tld文件夹下
(2)web.xml
<jsp-config> <taglib> <taglib-uri>http://java.sun.com/jstl/core</taglib-uri> <taglib-location>/WEB-INF/tld/c.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri> <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location> </taglib> </jsp-config>
自动加载方式
Servlet2.4规范提供了对tld文件的自动加载,tld文件在standard.jar的META-INF文件夹中
三、JSP中使用taglib
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
原文:http://blog.csdn.net/hekewangzi/article/details/44538617