| 属性名 | 是否支持EL | 属性类型 | 属性描述 | 
| value | true | Object | 指定要输出的内容 | 
| escapeXml | true | Boolean | 指定是否将>、<、&、‘、" 等 特殊字符进行HTML编码转换 后再进行输出。默认值是true。 | 
| default | true | Object | 指定如果value属性的值为null时所输出的默认值 | 
<!-- c:out 输出数据到浏览器 -->
<c:out value="Hello c out "></c:out>
Hello c out 
<!-- 输出一个变量 -->
<c:set var="m" value="10" scope="page"/>
<c:out value="${m}"></c:out>
${m }
<!-- 转义HTML 默认转义,通过设置escapeXml 为false 不进行转义-->
<c:out value="<a href=‘xxx‘>link</a>" />
${fn:escapeXml("<a href=‘xxx‘>link</a>") }
<!-- 允许输出默认值 ,如果city不存在,输出北京-->
<c:out value="${city}" default="北京"></c:out>
${empty city?"北京":city }
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h4>传统方式</h4>
<%= "Hello" %>
<%
	int a = 10;
	request.setAttribute("name", "xy");
%>
<%= a %>
<h4>JSTL的方式 </h4>
<c:out value="Hello"></c:out>
<c:out value="${name }"></c:out>
<!-- "" -->
<c:out value="${ city }" default="北京"></c:out>
<c:out value="<a href=‘#‘>超链接</a>" escapeXml="false"/>
<c:out value="<a href=‘#‘>超链接2</a>" escapeXml="true"/>
</body>
</html>| 属性名 | 是否支持EL | 属性类型 | 属性描述 | 
| value | true | Object | 用于指定属性 | 
| var | false | String | 用于指定要设置的Web域属性的名称 | 
| scope | false | String | 用于指定属性所在的Web域 | 
| target | true | Object | 用于指定要设置属性的对象,这个对象必须是 JavaBean对象或java.util.Map对象 | 
| property | true | String | 用于指定当前要为对象设置的属性名称 | 
<%@page import="cn.itcast.vo.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h4>传统方式</h4>
<%
	pageContext.setAttribute("name", "10", pageContext.REQUEST_SCOPE);
	
%>
<%
	User user = new User();
	user.setUsername("美美");
	user.setPassword("123");
	request.setAttribute("user", user);
%>
${ user.username }
<h4>JSTL方式</h4>
<c:set var="i" value="10" scope="request" ></c:set>
${ i }
<c:set target="${ user }" property="username"  value="小凤"></c:set>
${ user.username }
</body>
</html><%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h4>传统方式</h4>
<%
	request.setAttribute("name", "美美");
	request.removeAttribute("name");
%>
<c:set var="name" value="小凤" scope="page"></c:set>
${ name }
<c:remove var="name" scope="page"/>
${name }
</body>
</html><%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h4>传统方式</h4>
<%
	try{
		
	}catch(Exception e){
		e.printStackTrace();
	}
%>
<h4>JSTL的方式</h4>
<c:catch var="e">
	<%
		int a = 10/0;
	%>
</c:catch>
${ e.message }
</body>
</html>| 属性名 | 是否支持EL | 属性类型 | 属性描述 | 
| test | true | boolean | 决定是否处理标签体中的内容的条件表达式 | 
| var | false | String | 用于指定将test属性的执行结果保存到某个Web域中的某个属性的名称 | 
| scope | false | String | 指定将test属性的执行结果保存到哪个Web域中 | 
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h4>传统方式</h4>
<%
	int a = 10;
	if(a >= 10){
		out.print("a >= 10");
	}else{
		out.print("a < 10");
	}
%>
<h4>JSTL方式</h4>
<c:set var="i" value="10" scope="page"></c:set>
<c:if test="${ i ge 10 }" var="x" scope="page">
	i >= 10
</c:if>
<c:if test="${ i lt 10 }">
	i < 10
</c:if>
${ x }
</body>
</html><%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h4>获取参数</h4>
<%= request.getParameter("username") %>
<h4>传统方式</h4>
<%
	int a = 10;
	if(a >= 10 ){
		out.print("a >= 10");
	}else if(a < 10){
		out.print("a < 10");
	}else{
		out.print("其他");
	}
%>
<h4>JSTL方式</h4>
<c:set var="i" value="10" scope="page"></c:set>
<c:choose>
	<c:when test="${ i ge 10 }">
		i >= 10
	</c:when>
	<c:when test="${ i lt 10 }">
		i < 10
	</c:when>
	<c:otherwise>
		其他
	</c:otherwise>
</c:choose>
	
</body>
</html>| 属性名 | 是否支持EL | 属性类型 | 属性描述 | 
| var | false | String | 指定将当前迭代到的元素保存到page这个域中的属性名称 | 
| varStatus | false | String | 记住用于保存迭代信息的对象 | 
| items | true | 任何支持的类型 | 将要迭代的集合对象 | 
| begin | true | int | 如果指定items属性,就从集合中的第begin个元素开始进行迭代 ,begin的索引值从0开始编号,如果没有指定items属性,就从 begin指定的值开始迭代,直到end值时结束迭代 | 
| end | true | int | 与begin属性类似 | 
| step | true | int | 指定迭代的步长,即迭代因子的迭代增量 | 
<c:forEach>迭代数据
| 属性 | 类型 | 意义 | 
| index | number | 现在指到成员的索引 | 
| count | number | 总共指到成员的总数 | 
| first | boolean | 现在指到的成员是否是第一个成员 | 
| last | boolean | 现在指到的成员是否是最后一个成员 | 
<%@page import="cn.itcast.vo.User"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h4>遍历数组</h4>
<%
	String [] arrs = {"美美","小凤","芙蓉","小苍"};
	request.setAttribute("arrs", arrs);
%>
<!-- for(String s : arrs){ }  -->
<c:forEach var="s" items="${ arrs }">
	${ s }
</c:forEach>
<h4>遍历集合</h4>
<%
	List<String> list = new ArrayList<String>();
	list.add("美美");
	list.add("小凤");
	list.add("芙蓉");
	list.add("小泽");
	request.setAttribute("list", list);
%>
<c:forEach var="s" items="${ list }">
	${ s }
</c:forEach>
<h4>遍历Map集合</h4>
<%
	Map<String,String> map = new HashMap<String,String>();
	map.put("aa", "美美");
	map.put("bb", "小凤");
	map.put("cc", "芙蓉");
	request.setAttribute("map", map);
%>
<c:forEach var="entry" items="${ map }">
	${ entry.key } -- ${ entry.value }
</c:forEach>
<h4>遍历对象的集合</h4>
<%
	List<User> uList = new ArrayList<User>();
	uList.add(new User("美美","123"));
	uList.add(new User("小风","234"));
	uList.add(new User("芙蓉","345"));
	request.setAttribute("uList", uList);
%>
<c:forEach var="user" items="${ uList }">
	${ user.username } -- ${ user.password }
</c:forEach>
<h4>迭代数据</h4>
<h4>迭代从1到10</h4>
<c:forEach var="i" begin="1" end="10" step="2">
	${ i }
</c:forEach>
<h4>计算从1加到100的和</h4>
<c:set var="sum" value="0" scope="page"></c:set>
<c:forEach var="i" begin="1" end="100" step="1" varStatus="status">
	<c:set var="sum" value="${ sum + i }"></c:set>
</c:forEach>
${ sum }
<h4>遍历10到100的偶数,每到第3个数,显示红色</h4>
<c:forEach var="i" begin="10" end="100" step="2" varStatus="status">
	<c:choose>
		<c:when test="${ status.first }">
			<font color="blue">${ i }</font>
		</c:when>
		<c:when test="${ status.count % 3 eq 0 }">
			<font color="red">${ i }</font>
		</c:when>
		<c:otherwise>
			${ i }
		</c:otherwise>
	</c:choose>
</c:forEach>
</body>
</html>| 名称 | 说明 | EL | 类型 | 必须 | 默认值 | 
| var | 用来存放现在指到的成员 | N | String | 否 | 无 | 
| items | 被迭代的字符串 | Y | String | 是 | 无 | 
| delims | 定义用来分割字符串的字符 | N | String | 是 | 无 | 
| varStatus | 用来存放现在指到的相关成员信息 | N | String | 否 | 无 | 
| begin | 开始的位置 | Y | int | 否 | 0 | 
| end | 结束的位置 | Y | int | 否 | 最后一个成员 | 
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h4>分隔字符串</h4>
<c:set var="i" value="aa,bb,cc" scope="page"></c:set>
<c:forTokens items="${i }" delims="," var="x">
	${ x }
</c:forTokens>
</body>
</html>| 名称 | 说明 | EL | 类型 | 必须 | 默认值 | 
| url | 一文件被包含的地址 | Y | String | 是 | 无 | 
| context | 项目虚拟路径 | Y | String | 否 | 无 | 
| var | 储存被包含的文件的内容(以String类型存入) | Y | String | 否 | 无 | 
| scope | var变量的JSP范围 | N | String | 否 | page | 
| charEncoding | 被包含文件的内容的编码方式 | Y | String | 否 | 无 | 
| varReader | 储存被包含的文件的内容(以Reader类型存入) | N | String | 否 | 无 | 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h4>JSTL方式</h4>
<c:import url="/jstl/choose.jsp" context="/day13" var="i" scope="page">
	<c:param name="username" value="meimei"></c:param>
</c:import>
${ i }
</body>
</html>| 属性名 | 是否支持EL | 属性类型 | 属性描述 | 
| value | true | String | 指定要构造的URL | 
| var | false | String | 指定将构造出的URL结果保存到Web域中的属性名称 | 
| scope | false | String | 指定将构造出的URL结果保存在哪个域中 | 
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h4>JSTL方式</h4>
<c:url var="i" value="/jstl/choose.jsp" scope="request" context="/day13">
	<c:param name="username" value="xiaofeng"></c:param>
</c:url>
<c:set var="s" value="刘勋" scope="session"></c:set>
<a href="${ i }">choose</a> <br>
i= ${i } <br>
<%
    String url = "/day12/index.jsp";
    url = response.encodeURL(url);
%>
<!-- 将/day8/index.jsp 进行url重写,保存page范围 myurl中 -->
<c:url value="/index.jsp" context="/day13" var="myurl" scope="page" />
url=  <%=url %> <br>
myurl= ${myurl } <br>
<!-- 通过c:url 结合 c:param 对中文完成URL编码 -->
<c:url value="/login" context="/day13" var="myurl2" scope="page">
	<c:param name="username" value="张三"></c:param>
</c:url>
myurl2= ${myurl2 } <br>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<c:out value="${s }"></c:out>
<h4>获取参数</h4>
<%= request.getParameter("username") %>
<h4>传统方式</h4>
<%
	int a = 10;
	if(a >= 10 ){
		out.print("a >= 10");
	}else if(a < 10){
		out.print("a < 10");
	}else{
		out.print("其他");
	}
%>
<h4>JSTL方式</h4>
<c:set var="i" value="10" scope="page"></c:set>
<c:choose>
	<c:when test="${ i ge 10 }">
		i >= 10
	</c:when>
	<c:when test="${ i lt 10 }">
		i < 10
	</c:when>
	<c:otherwise>
		其他
	</c:otherwise>
</c:choose>
	
</body>
</html>禁用浏览器的cookie后,运行如下:| 属性名 | 是否支持EL | 属性类型 | 属性描述 | 
| url | true | String | 指定要转发或重定向到的目标资源的URL地址 | 
| context | true | String | 当要使用相对路径重定向到同一个服务器下的其他WEB应用程序中的 资源时,context属性指定其他WEB应用程序的名称 | 
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h4>JSTL方式</h4>
<c:redirect url="/jstl/choose.jsp" context="/day13">
	<c:param name="username" value="furong"></c:param>
</c:redirect>
</body>
</html>package cn.itcast.el;
public class ElDemo1 {
	
	public static String sayHello(String name){
		return "hello "+name;
	}
	
}
在WebRoot/WEB-INF下新建myfn的tld文件 并进行配置:<?xml version="1.0" encoding="UTF-8"?> <taglib version="2.0" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"> <tlib-version>1.0</tlib-version> <short-name>myfn</short-name> <uri>http://www.itcast.cn/1110/myfn</uri> <!-- 配置自定义的EL函数 --> <function> <!-- 配置方法名称 --> <name>sayHi</name> <!-- 方法所在的类 --> <function-class>cn.itcast.el.ElDemo1</function-class> <!-- 配置方法的签名 --> <function-signature>java.lang.String sayHello(java.lang.String)</function-signature> </function> </taglib>在WebRoot根目录下新建el文件夹,在里面新建demo.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.itcast.cn/1110/myfn" prefix="myfn" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
${ fn:length("abcdefg") }
${ fn:toUpperCase("abcdefg") }
${ myfn:sayHi("小风") }
</body>
</html>| 元素名 | 是否必须指定 | 描述 | 
| description | 否 | 用于指定属性的描述信息 | 
| name | 是 | 用于指定属性的名称。属性名称是大小写敏感的,并且不能以jsp、 _jsp、java和sun开头 | 
| required | 否 | 用于指定在JSP页面中调用自定义标签时是否必须设置这个属性。其 取值包括true和false,默认值是false,true表示必须设置,否则可以 设置也可以不设置该属性。 | 
| rtexprvalue | 否 | rtexprvalue是runtime expression value(运行时表达式)的英文简写, 用于指定属性值是一个静态值或动态值。其取值包括true和false,默认值 是false,false表示只能为该属性指定静态文本值,例如"123"; true表示可 以为该属性指定一个JSP动态元素,动态元素的结果作为属性值,例如 JSP表达式<%=value %> | 
| type | 否 | 用于指定属性值的Java类型。默认是String | 
package cn.itcast.tag;
import java.io.IOException;
import javax.servlet.jsp.JspContext;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;
/**
 * 对外输出Hello
 * @author Administrator
 *
 */
public class TagDemo1 extends SimpleTagSupport{
	
	private PageContext pc;
	
	public void doTag() throws JspException, IOException {
		pc.getOut().write("Hello");
	}
	
	/**
	 * 服务器默认先执行该方法
	 */
	public void setJspContext(JspContext pc) {
		this.pc = (PageContext) pc;
	}
}TagDemo2.java (有标签体 处理标签体内容)package cn.itcast.tag;
import java.io.IOException;
import java.io.StringWriter;
import javax.servlet.jsp.JspContext;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.JspFragment;
import javax.servlet.jsp.tagext.SimpleTagSupport;
/**
 * 带有标签主体
 * @author Administrator
 *
 */
public class TagDemo2 extends SimpleTagSupport{
	
	private PageContext pc;
	
	public void doTag() throws JspException, IOException {
		JspFragment jf = getJspBody();
		StringWriter sw = new StringWriter();
		//通过invoke方法将标签体内容写入到参数Writer对象sw中
		jf.invoke(sw);
		// 获取标签体内容
		String content = sw.toString().toUpperCase();
		pc.getOut().print(content);
	}
	
	public void setJspContext(JspContext pc) {
		this.pc = (PageContext)pc;
	}
}
TagDemo3.java (有属性 有标签体的自定义标签)package cn.itcast.tag;
import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
/**
 * 类似<c:if>标签,带有属性的
 * @author Administrator
 *
 */
public class TagDemo3 extends SimpleTagSupport{
	
	private boolean test;
	
	public void setTest(boolean test) {
		this.test = test;
	}
	
	public void doTag() throws JspException, IOException {
		if(test){
			getJspBody().invoke(null);
		}
	}
	
}<?xml version="1.0" encoding="UTF-8"?> <taglib version="2.0" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"> <tlib-version>1.0</tlib-version> <short-name>myc</short-name> <uri>http://www.itcast.cn/1110/myc</uri> <!-- 配置自定义标签 --> <tag> <!-- 配置标签名称 --> <name>print</name> <!-- 配置标签的类 --> <tag-class>cn.itcast.tag.TagDemo1</tag-class> <!-- 配置标签主体 --> <body-content>empty</body-content> </tag> <!-- 配置自定义标签 --> <tag> <!-- 配置标签名称 --> <name>out</name> <!-- 配置标签的类 --> <tag-class>cn.itcast.tag.TagDemo2</tag-class> <!-- 配置标签主体 --> <body-content>scriptless</body-content> </tag> <!-- 配置自定义标签 --> <tag> <!-- 配置标签名称 --> <name>if</name> <!-- 配置标签的类 --> <tag-class>cn.itcast.tag.TagDemo3</tag-class> <!-- 配置标签主体 --> <body-content>scriptless</body-content> <!-- 配置属性 --> <attribute> <!-- 配置属性名称 --> <name>test</name> <!-- 属性是否是必须的 --> <required>true</required> <!-- 是否支持EL表达式 --> <rtexprvalue>true</rtexprvalue> <!-- 属性的类型 --> <type>boolean</type> </attribute> </tag> </taglib>在WebRoot下新建tag文件夹,新建tag.jsp 测试自定义标签内容
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ taglib uri="http://www.itcast.cn/1110/myc" prefix="myc" %>    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<myc:print/>
<myc:out>
	liuxun1993
</myc:out>
<c:set var="i" value="10"></c:set>
<myc:if test="${ i eq 10 }">
	美美
</myc:if>
</body>
</html>启动服务器,运行结果如下:JAVAWEB开发之JSTL标签库的使用、 自定义EL函数、自定义标签(带属性的、带标签体的)
原文:http://blog.csdn.net/u013087513/article/details/54847678