1. 程式人生 > >在JSP中引入JSTL標籤庫

在JSP中引入JSTL標籤庫

<!-- JSTL 函式 包含一系列標準函式,大部分是通用的字串處理函式-->
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<!-- JSTL 核心標籤庫 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!-- JSTL 格式化標籤 用來格式化並輸出文字、日期、時間、數字 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<!-- JSTL SQL標籤庫 提供了與關係型資料庫進行互動的標籤 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>

<!-- JSTL XML標籤庫 提供了建立和操作XML文件的標籤 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
<wab-app>
    <jsp-config>
        <taglib>
            <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
            <taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
            <taglib-location>/WEB-INF/tlds/c-rt.tld</taglib-location>
        </taglib>
		
        <taglib>
            <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
            <taglib-location>/WEB-INF/fmt.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
            <taglib-location>/WEB-INF/fmt-rt.tld</taglib-location>
        </taglib>
		
        <taglib>
            <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
            <taglib-location>/WEB-INF/sql.tld</taglib-location>
        </taglib>
        <taglib>
	        <taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>
            <taglib-location>/WEB-INF/sql-rt.tld</taglib-location>
        </taglib>
		
        <taglib>
            <taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
            <taglib-location>/WEB-INF/x.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
            <taglib-location>/WEB-INF/x-rt.tld</taglib-location>
        </taglib>
		
        <taglib>
            <taglib-uri>http://java.sun.com/jstl/fn</taglib-uri>
            <taglib-location>/web-inf/fn.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>http://java.sun.com/jstl/fn-rt</taglib-uri>
            <taglib-location>/WEB-INF/fn-rt.tld</taglib-location>
        </taglib>
    </jsp-config>
</web-app>