---
title: "JSTL-下载测试"
author: "xuxujing"
date: "2014-03-03T10:19:47Z"
tags: []
categories: ["行业应用"]
slug: "jstl"
draft: false
lastmod: "2014-03-03T14:40:32Z"
id: 2024770
url: "https://xujava.iteye.com/blog/2024770"
---

1.下载地址

[http://jakarta.apache.org/](http://jakarta.apache.org/)

点击Taglibs，点击Standard进入下载页下载。

 

当前版本为1.2.1，下载4个Jar包：

taglibs-standard-compat-1.2.1.jar

taglibs-standard-impl-1.2.1.jar

taglibs-standard-jstlel-1.2.1.jar

taglibs-standard-spec-1.2.1.jar

 

2.JavaDoc地址

[http://tomcat.apache.org/taglibs/standard/apidocs/](http://tomcat.apache.org/taglibs/standard/apidocs/)

 

3.测试

新建Web工程，复制4个Jar包到WEB-INF/lib目录下，新建JSP页面，JSP页面内容如下：

```
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<title>JSTL测试页</title>
</head>
<body>
	<%
		String items[] = new String[3];
		items[0] = "Hello World!";
		items[1] = "Jstl标签 1.2.1版";
		items[2] = "测试页面";
		request.setAttribute("items", items);
	%>
	<h4>
		<c:out value="JSTL 测试" />
	</h4>
	 
	<table border="1">
		<c:forEach var="item" items="${items}">
			<tr>
				<td><c:out value="${item}"></c:out></td>
			</tr>
		</c:forEach>
	</table>
</body>
</html>
```

 

启动Tomcat，输出如下：

 

#### JSTL 测试

 

Hello World! Jstl标签 1.2.1版 测试页面