• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            逛奔的蝸牛

            我不聰明,但我會(huì)很努力

               ::  :: 新隨筆 ::  ::  :: 管理 ::

            JSTL 1.2.x is the latest version of JSTL. There are a few differences between this version and the previous JSTL 1.1.x version. The most important difference is that JSTL 1.2.x supports Unified EL (Expression Language) , where as JSTL 1.1.x supports only traditional EL. With Unified EL it becomes very easy to combine the EL in JSF (Java Server Faces) and the EL in JSTL. This guide shows you how to install JSTL 1.2.x properly or troubleshoot your existing JSTL installation. (from: http://hi.baidu.com/kelly_zsl/blog/item/e004562e4f3363331f3089a0.html)


            1. 需要的jar包: jstl-1.2.jar

            2. 復(fù)制此jstl-1.2.jar到Web工程的WEB-INFO/lib目錄,不需要任何其他的配置,就可以在JSP頁(yè)面中使用jstl了.

            3. 示例: 在頁(yè)面中輸出 1 到 10

            <%@ page language="java" contentType="text/html; charset=UTF-8"

            pageEncoding="ISO-8859-1"%>

            <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>


            <!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:forEach var="i" begin="1" end="10" step="1">

            <c:out value="${i}" />

            </c:forEach>

            </body>


            EL只操作屬性,所操作的類應(yīng)該是JavaBean規(guī)范的,所操作的屬性要有g(shù)etter, setter.

            ${user.username}: 默認(rèn)是從request(page)中取,如果request中沒(méi)有名為username的對(duì)象則從session中取,session中沒(méi)有則從application(servletContext)中取,如果沒(méi)有取到任何值則不顯示。

            </html>


            訪問(wèn)ArrayList的方式:

            1. 放入request.setAttribute()或者session.setAttriute(),然后items="${users}"

            <table border=1>

            <tr>

            <td>用戶名</td><td>密碼</td>

            </tr>

            <c:forEach var="users" items="${users}">

            <tr>

            <td><c:out value="${users.username}" /></td>

            <td><c:out value="${users.password}" /></td>

            </tr>

            </c:forEach>

            </table>


            2. 使用JSP的賦值表達(dá)式 items="<%= users %>",這種方式也可以訪問(wèn)數(shù)組

            <table border=1>

                <tr>

                    <td>用戶名</td><td>密碼</td>

                </tr>

                <c:forEach var="users" items="<%= users %>">

                    <tr>

                        <td><c:out value="${users.username}" /></td>

                        <td><c:out value="${users.password}" /></td>

                    </tr>

                </c:forEach>

            </table>

            學(xué)習(xí)示例: http://www.java2s.com/Tutorial/Java/0380__JSTL/Catalog0380__JSTL.htm


            posted on 2010-12-22 18:13 逛奔的蝸牛 閱讀(559) 評(píng)論(0)  編輯 收藏 引用 所屬分類: Java
            久久亚洲春色中文字幕久久久| 久久久久久噜噜精品免费直播| 亚洲国产精品无码久久青草| 热久久最新网站获取| 亚洲人成网站999久久久综合| 亚洲午夜久久久久久久久电影网| 久久人人爽人人爽人人av东京热| 久久综合给合久久狠狠狠97色| 女人香蕉久久**毛片精品| 久久伊人影视| 久久久久久毛片免费播放| 狠狠人妻久久久久久综合| 2021国产精品久久精品| 久久99国产精品二区不卡| 人妻无码精品久久亚瑟影视| 国产精品18久久久久久vr| 亚洲伊人久久成综合人影院 | 国内精品久久久久影院一蜜桃 | 亚洲精品无码久久久久| 中文字幕成人精品久久不卡| 狠狠精品久久久无码中文字幕| 91久久精品电影| 久久99精品久久久久久hb无码| 一级女性全黄久久生活片免费| 日本久久久精品中文字幕| 久久人妻AV中文字幕| 久久性生大片免费观看性| 久久精品视频免费| 久久婷婷五月综合色奶水99啪| 国产精品久久久久免费a∨| 国产精品久久久久久久久久免费| 91视频国产91久久久| 亚洲AV无码1区2区久久| 一本一本久久aa综合精品| 亚洲精品综合久久| 久久国产精品国语对白| 激情综合色综合久久综合| 9191精品国产免费久久| 久久久久久a亚洲欧洲aⅴ| 久久九九有精品国产23百花影院| 久久久久久人妻无码|