配置标签:
<taglib>
<taglib-uri>/WEB-INF/jUtil.tld</taglib-uri>
<taglib-location>/WEB-INF/tlds/jbasUtil.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/app.tld</taglib-uri>
<taglib-location>/WEB-INF/tlds/app.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
</taglib>
<taglib>
jsp页面里调用:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/jUtil.tld" prefix="jutil"%>
<%@ taglib uri="/WEB-INF/app.tld" prefix="app" %>
<c:forEach var=”row” items=”${org}” begin=”0” end=”1” step=”1”>
…………${row.orgjoint}
</c:forEach>
row:引用的对象。
items:记录集
begin: end step 分别代表开始,结束。步长。。可缺省
<c:if test="
expression" var="
name" scope="
scope">
body content
</c:if>
<c:if test="${row.joint > '0'}">
<img src="images/starorg.gif" width="25" height="24" align="middle"> </c:if>
<c:url> 操作的语法
<c:url value="
expression" context="
expression"
var="
name" scope="
scope">
<c:param name="
expression" value="
expression"/>
...
</c:url>
<a href="<c:url value='/content/sitemap.jsp'/>">View sitemap</a>
<c:import> 操作的语法
<c:import url="
expression" context="
expression"
charEncoding="
expression" var="
name" scope="
scope">
<c:param name="
expression" value="
expression"/>
...
</c:import>
将 <c:import> 与 <c:catch> 相结合的示例
<c:catch var="exception">
<c:import url="ftp://ftp.example.com/package/README"/>
</c:catch>
<c:if test="${not empty exception}">
Sorry, the remote content is not currently available.
</c:if>
<c:forEach var="
name" varStatus="
name"
begin="
expression" end="
expression" step="
expression">
body content
</c:forEach>