<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # JSP 標準標簽庫(JSTL) JSP標準標簽庫(JSTL)是一個JSP標簽集合,它封裝了JSP應用的通用核心功能。 JSTL支持通用的、結構化的任務,比如迭代,條件判斷,XML文檔操作,國際化標簽,SQL標簽。 除了這些,它還提供了一個框架來使用集成JSTL的自定義標簽。 根據JSTL標簽所提供的功能,可以將其分為5個類別。 * **核心標簽** * **格式化標簽** * **SQL 標簽** * **XML 標簽** * **JSTL 函數** ## JSTL 庫安裝 Apache Tomcat安裝JSTL 庫步驟如下: * 從Apache的標準標簽庫中下載的二進包(jakarta-taglibs-standard-current.zip)。下載地址:[http://archive.apache.org/dist/jakarta/taglibs/standard/binaries/](//archive.apache.org/dist/jakarta/taglibs/standard/binaries/) * 下載jakarta-taglibs-standard-1.1.1.zip 包并解壓,將jakarta-taglibs-standard-1.1.1/lib/下的兩個jar文件:standard.jar和jstl.jar文件拷貝到/WEB-INF/lib/下。 使用任何庫,你必須在每個JSP文件中的頭部包含&lt;taglib&gt;標簽。 ## 核心標簽 核心標簽是最常用的JSTL標簽。引用核心標簽庫的語法如下: ``` <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> ``` | 標簽 | 描述 | | --- | --- | | [&lt;c:out&gt;](jstl-core-out-tag.html) | 用于在JSP中顯示數據,就像&lt;%= ... &gt; | | [&lt;c:set&gt;](jstl-core-set-tag.html) | 用于保存數據 | | [&lt;c:remove&gt;](jstl-core-remove-tag.html) | 用于刪除數據 | | [&lt;c:catch&gt;](jstl-core-catch-tag.html) | 用來處理產生錯誤的異常狀況,并且將錯誤信息儲存起來 | | [&lt;c:if&gt;](jstl-core-if-tag.html) | 與我們在一般程序中用的if一樣 | | [&lt;c:choose&gt;](jstl-core-choose-tag.html) | 本身只當做&lt;c:when&gt;和&lt;c:otherwise&gt;的父標簽 | | [&lt;c:when&gt;](jstl-core-choose-tag.html) | &lt;c:choose&gt;的子標簽,用來判斷條件是否成立 | | [&lt;c:otherwise&gt;](jstl-core-choose-tag.html) | &lt;c:choose&gt;的子標簽,接在&lt;c:when&gt;標簽后,當&lt;c:when&gt;標簽判斷為false時被執行 | | [&lt;c:import&gt;](jstl-core-import-tag.html) | 檢索一個絕對或相對 URL,然后將其內容暴露給頁面 | | [&lt;c:forEach&gt;](jstl-core-foreach-tag.html) | 基礎迭代標簽,接受多種集合類型 | | [&lt;c:forTokens&gt;](jstl-core-foreach-tag.html) | 根據指定的分隔符來分隔內容并迭代輸出 | | [&lt;c:param&gt;](jstl-core-param-tag.html) | 用來給包含或重定向的頁面傳遞參數 | | [&lt;c:redirect&gt;](jstl-core-redirect-tag.html) | 重定向至一個新的URL. | | [&lt;c:url&gt;](jstl-core-url-tag.html) | 使用可選的查詢參數來創造一個URL | ## 格式化標簽 JSTL格式化標簽用來格式化并輸出文本、日期、時間、數字。引用格式化標簽庫的語法如下: ``` <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> ``` | 標簽 | 描述 | | --- | --- | | [&lt;fmt:formatNumber&gt;](jstl-format-formatnumber-tag.html) | 使用指定的格式或精度格式化數字 | | [&lt;fmt:parseNumber&gt;](jstl-format-parsenumber-tag.html) | 解析一個代表著數字,貨幣或百分比的字符串 | | [&lt;fmt:formatDate&gt;](jstl-format-formatdate-tag.html) | 使用指定的風格或模式格式化日期和時間 | | [&lt;fmt:parseDate&gt;](jstl-format-parsedate-tag.html) | 解析一個代表著日期或時間的字符串 | | [&lt;fmt:bundle&gt;](jstl-format-bundle-tag.html) | 綁定資源 | | [&lt;fmt:setLocale&gt;](jstl-format-setlocale-tag.html) | 指定地區 | | [&lt;fmt:setBundle&gt;](jstl-format-setbundle-tag.html) | 綁定資源 | | [&lt;fmt:timeZone&gt;](jstl-format-timezone-tag.html) | 指定時區 | | [&lt;fmt:setTimeZone&gt;](jstl-format-settimezone-tag.html) | 指定時區 | | [&lt;fmt:message&gt;](jstl-format-message-tag.html) | 顯示資源配置文件信息 | | [&lt;fmt:requestEncoding&gt;](jstl-format-requestencoding-tag.html) | 設置request的字符編碼 | ## SQL標簽 JSTL SQL標簽庫提供了與關系型數據庫(Oracle,MySQL,SQL Server等等)進行交互的標簽。引用SQL標簽庫的語法如下: ``` <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %> ``` | 標簽 | 描述 | | --- | --- | | [&lt;sql:setDataSource&gt;](jstl-sql-setdatasource-tag.html) | 指定數據源 | | [&lt;sql:query&gt;](jstl-sql-query-tag.html) | 運行SQL查詢語句 | | [&lt;sql:update&gt;](jstl-sql-update-tag.html) | 運行SQL更新語句 | | [&lt;sql:param&gt;](jstl-sql-param-tag.html) | 將SQL語句中的參數設為指定值 | | [&lt;sql:dateParam&gt;](jstl-sql-dateparam-tag.html) | 將SQL語句中的日期參數設為指定的java.util.Date?對象值 | | [&lt;sql:transaction&gt;](jstl-sql-transaction-tag.html) | 在共享數據庫連接中提供嵌套的數據庫行為元素,將所有語句以一個事務的形式來運行 | ## XML 標簽 JSTL XML標簽庫提供了創建和操作XML文檔的標簽。引用XML標簽庫的語法如下: ``` <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %> ``` 在使用xml標簽前,你必須將XML 和 XPath 的相關包拷貝至你的&lt;Tomcat 安裝目錄&gt;\lib下: XercesImpl.jar: 下載地址: [http://www.apache.org/dist/xerces/j/](//www.apache.org/dist/xerces/j/) xalan.jar: 下載地址: [http://xml.apache.org/xalan-j/index.html](//xml.apache.org/xalan-j/index.html) | 標簽 | 描述 | | --- | --- | | [&lt;x:out&gt;](jstl-xml-out-tag.html) | 與&lt;%= ... &gt;,類似,不過只用于XPath表達式 | | [&lt;x:parse&gt;](jstl-xml-parse-tag.html) | 解析 XML 數據 | | [&lt;x:set&gt;](jstl-xml-set-tag.html) | 設置XPath表達式 | | [&lt;x:if&gt;](jstl-xml-if-tag.html) | 判斷XPath表達式,若為真,則執行本體中的內容,否則跳過本體 | | [&lt;x:forEach&gt;](jstl-xml-foreach-tag.html) | 迭代XML文檔中的節點 | | [&lt;x:choose&gt;](jstl-xml-choose-tag.html) | &lt;x:when&gt;和&lt;x:otherwise&gt;的父標簽 | | [&lt;x:when&gt;](jstl-xml-choose-tag.html) | &lt;x:choose&gt;的子標簽,用來進行條件判斷 | | [&lt;x:otherwise&gt;](jstl-xml-choose-tag.html) | &lt;x:choose&gt;的子標簽,當&lt;x:when&gt;判斷為false時被執行 | | [&lt;x:transform&gt;](jstl-xml-transform-tag.html) | 將XSL轉換應用在XML文檔中 | | [&lt;x:param&gt;](jstl-xml-param-tag.html) | 與&lt;x:transform&gt;共同使用,用于設置XSL樣式表 | ## JSTL函數 JSTL包含一系列標準函數,大部分是通用的字符串處理函數。引用JSTL函數庫的語法如下: ``` <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> ``` | 函數 | 描述 | | --- | --- | | [fn:contains()](jstl-function-contains.html) | 測試輸入的字符串是否包含指定的子串 | | [fn:containsIgnoreCase()](jstl-function-containsignoreCase.html) | 測試輸入的字符串是否包含指定的子串,大小寫不敏感 | | [fn:endsWith()](jstl-function-endswith.html) | 測試輸入的字符串是否以指定的后綴結尾 | | [fn:escapeXml()](jstl-function-escapexml.html) | 跳過可以作為XML標記的字符 | | [fn:indexOf()](jstl-function-indexof.html) | 返回指定字符串在輸入字符串中出現的位置 | | [fn:join()](jstl-function-join.html) | 將數組中的元素合成一個字符串然后輸出 | | [fn:length()](jstl-function-length.html) | 返回字符串長度 | | [fn:replace()](jstl-function-replace.html) | 將輸入字符串中指定的位置替換為指定的字符串然后返回 | | [fn:split()](jstl-function-split.html) | 將字符串用指定的分隔符分隔然后組成一個子字符串數組并返回 | | [fn:startsWith()](jstl-function-startswith.html) | 測試輸入字符串是否以指定的前綴開始 | | [fn:substring()](jstl-function-substring.html) | 返回字符串的子集 | | [fn:substringAfter()](jstl-function-substringafter.html) | 返回字符串在指定子串之后的子集 | | [fn:substringBefore()](jstl-function-substringbefore.html) | 返回字符串在指定子串之前的子集 | | [fn:toLowerCase()](jstl-function-tolowercase.html) | 將字符串中的字符轉為小寫 | | [fn:toUpperCase()](jstl-function-touppercase.html) | 將字符串中的字符轉為大寫 | | [fn:trim()](jstl-function-trim.html) | 移除首位的空白符 |
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看