<%@ page contentType="text/html;charset=GBK" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@page isELIgnored="false"%>
<%  String[] cars = { "Ferrari", "Porshe", "Toyota" }; %>
<c:set var="simple" value="${2+1}" scope="page"  />
<c:set var="bike" value="Ninja:CBR 600;Ducati|BMW" scope="page" />
<% pageContext.setAttribute("Example", "CoreTag",PageContext.PAGE_SCOPE); %>
<HTML>
<HEAD>
<TITLE>使用核心标签库</TITLE>
</HEAD>
<BODY>
有 <c:out value="${pageScope.simple}" /> 种汽车, 名称是: <br />
<UL>
<c:forEach var="car" items="<%= cars %>">
<LI><c:out value="${car}" />
</c:forEach>
</UL>
自行车的名称是: <br/>
<c:forTokens items="${pageScope.bike}" delims=":;|"
var="bikenames">
<UL>
<LI> <c:out value="${bikenames}" /> <br />
</UL>
</c:forTokens>
<c:remove var="simple" scope="page"/>
<c:if test="${pageScope.Example == 'CoreTag'}">
<c:set var="Success" value="true" scope="page" />
</c:if>
<c:choose>
<c:when test="${pageScope.Success == true}">
成功显示名称
</c:when>
<c:otherwise>
显示名称失败
</c:otherwise>
</c:choose>
</BODY>
</HTML>
