1、下载JSTL包
https://archive.apache.org/dist/jakarta/taglibs/standard/binaries/jakarta-taglibs-standard-1.1.2.zip
2、部署
将lib下的两个jar包复制到WEB-INF\lib\目录下
将tld下的所有tld文件复制到WEB-INF\目录下
在web.xml文件中添加
1 <jsp-config>
2 <taglib>
3 <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
4 <taglib-location>/WEB-INF/c.tld</taglib-location>
5 </taglib>
6 <taglib>
7 <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
8 <taglib-location>/WEB-INF/fmt.tld</taglib-location>
9 </taglib>
10 <taglib>
11 <taglib-uri>http://java.sun.com/jsp/jstl/sql</taglib-uri>
12 <taglib-location>/WEB-INF/sql.tld</taglib-location>
13 </taglib>
14 <taglib>
15 <taglib-uri>http://java.sun.com/jsp/jstl/x</taglib-uri>
16 <taglib-location>/WEB-INF/x.tld</taglib-location>
17 </taglib>
18 <taglib>
19 <taglib-uri>http://java.sun.com/jsp/jstl/fn</taglib-uri>
20 <taglib-location>/WEB-INF/fn.tld</taglib-location>
21 </taglib>
22 </jsp-config>
3、应用
在test.jsp页面中
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <%@ page language="java" contentType="text/html; charset=UTF-8"
3 pageEncoding="UTF-8"%>
4 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
5 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6 <html xmlns="http://www.w3.org/1999/xhtml">
7 <head>
8 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
9 <title>JSTL</title>
10 </head>
11 <body>
12 <c:out value="Hello JSTL." />
13 </body>
14 </html>