亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? resultsettag.java

?? jakarta-taglibs
?? JAVA
字號:
/*
 * Copyright 1999,2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.taglibs.dbtags.resultset;

import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.BodyTagSupport;

import org.apache.taglibs.dbtags.statement.StatementTag;


/**
 * <p>JSP tag resultSet, executes the query and loops through the results
 * for the enclosing statement or preparedstatement tag.  The body of
 * this tag is executed once per row in the resultset.  The optional
 * "loop" attribute, which default to true, specifies whether to execute
 * the tag body once per row "true", or to simply assign the ResultSet
 * to the page attribute specified by "id". The optional "name" and "scope"
 * attributes can be used to retrieve a resultset (or rowset) from context.</p>
 *
 * <p>JSP Tag Lib Descriptor
 * <pre>
 * &lt;name>resultSet&lt;/name>
 * &lt;tagclass>org.apache.taglibs.dbtags.resultset.ResultSetTag&lt;/tagclass>
 * &lt;teiclass>org.apache.taglibs.dbtags.connection.ResultSetTEI&lt;/teiclass>
 * &lt;bodycontent>JSP&lt;/bodycontent>
 * &lt;info>JSP tag resulset, executes the query and loops through the results
 * for the enclosing statement or preparedstatement tag.  The body of
 * this tag is executed once per row in the resultset.  The optional
 * "loop" attribute, which default to true, specifies whether to execute
 * the tag body once per row "true", or to simply assign the ResultSet
 * to the page attribute specified by "id". The optional "name" and "scope"
 * attributes can be used to retrieve a resultset (or rowset) from context.<&lt;/info>
 *   &lt;attribute>
 *     &lt;name>id&lt;/name>
 *     &lt;required>true&lt;/required>
 *     &lt;rtexprvalue>false&lt;/rtexprvalue>
 *   &lt;/attribute>
 *   &lt;attribute>
 *     &lt;name>loop&lt;/name>
 *     &lt;required>false&lt;/required>
 *     &lt;rtexprvalue>false&lt;/rtexprvalue>
 *   &lt;/attribute>
 *   &lt;attribute>
 *     &lt;name>name&lt;/name>
 *     &lt;required>false&lt;/required>
 *     &lt;rtexprvalue>true&lt;/rtexprvalue>
 *   &lt;/attribute>
 *   &lt;attribute>
 *     &lt;name>scope&lt;/name>
 *     &lt;required>false&lt;/required>
 *     &lt;rtexprvalue>false&lt;/rtexprvalue>
 *   &lt;/attribute>
 * </pre>
 *
 * @author Morgan Delagrange
 * @author Ted Husted
 * @author Craig McClanahan
 * @see org.apache.taglibs.dbtags.statement.StatementImplTag
 * @see org.apache.taglibs.dbtags.statement.QueryTag
 * @see org.apache.taglibs.dbtags.preparedstatement.PreparedStatementImplTag
 */
public class ResultSetTag extends BodyTagSupport{

  private Statement _statement = null;
  private ResultSet _rset = null;
  private boolean _shouldLoop = true;
  private String _name = null;
  private String _scope = null;
  private int _rowCount = 0;

  /**
   * Locate and return the specified bean, from an optionally specified
   * scope, in the specified page context.  If no such bean is found,
   * return <code>null</code> instead.  If an exception is thrown, it will
   * have already been saved via a call to <code>saveException()</code>.
   *
   * @param pageContext Page context to be searched
   * @param name Name of the bean to be retrieved
   * @param scope Scope to be searched (page, request, session, application)
   *  or <code>null</code> to use <code>findAttribute()</code> instead
   *
   * @exception JspException if an invalid scope name
   *  is requested
   */
  protected Object lookup(PageContext pageContext,
      String name, String scope) throws JspTagException {

      Object bean = null;
      if (scope == null)
          bean = pageContext.findAttribute(name);
      else if (scope.equalsIgnoreCase("page"))
          bean = pageContext.getAttribute(name, PageContext.PAGE_SCOPE);
      else if (scope.equalsIgnoreCase("request"))
          bean = pageContext.getAttribute(name, PageContext.REQUEST_SCOPE);
      else if (scope.equalsIgnoreCase("session"))
          bean = pageContext.getAttribute(name, PageContext.SESSION_SCOPE);
      else if (scope.equalsIgnoreCase("application"))
          bean =
              pageContext.getAttribute(name, PageContext.APPLICATION_SCOPE);
      else {
          JspTagException e = new JspTagException("Invalid scope " + scope);
          throw e;
      }
      return (bean);

   }

  /**
   * Name of the bean that contains the rowset to process.
   */


  public void setName(String name) {
       _name = name;
   }

  public void setScope(String scope) {
       _scope = scope;
   }

  public void setLoop(boolean shouldLoop) {
    _shouldLoop = shouldLoop;
  }

  public ResultSet getResultSet() {
    return _rset;
  }

  public int doStartTag() throws JspTagException {

    // reset body's content, otherwise it could result in an error if container is pooling
    // tag handlers (see bug 26863 for more details)
    super.bodyContent = null;
    
      try {
            // if name property given, retrieve resultset from context
            // may also be a related class, like RowSet
        if (_name!=null) {
          _rset = (ResultSet) lookup(pageContext, _name, _scope);
        }
        else {
            StatementTag _stmtTag =
                (StatementTag) findAncestorWithClass(this,
                    Class.forName("org.apache.taglibs.dbtags.statement.StatementTag"));
            _rset = _stmtTag.executeQuery();
        }

        pageContext.setAttribute(getId(), _rset);

        if (_shouldLoop == false) {
            return EVAL_BODY_TAG;
        }

        if (_rset.next() == false) {
          setTotalRowCount(_rowCount);
          return SKIP_BODY;
        }

      ++_rowCount;
      setTotalRowCount(_rowCount);

    } catch (ClassNotFoundException e) {
      throw new JspTagException(e.toString());
    } catch (SQLException e) {
      throw new JspTagException(e.toString());
    }

    return EVAL_BODY_TAG;
  }

  public int doEndTag() throws JspTagException{
    pageContext.removeAttribute(getId());
    try {
      if (getBodyContent() != null && getPreviousOut() != null) {
        getPreviousOut().write(getBodyContent().getString());
      }
    } catch (IOException e) {
      throw new JspTagException(e.toString());
    } finally {
      try {
        _rset.close();
      }
      catch (SQLException e) {
        // it's not fatal if the result set cannot be closed
        e.printStackTrace();
      }
    }

    // we have to call this guy manually now
    // with the spec clarification
    release();

    return EVAL_PAGE;
  }

  public int doAfterBody() throws JspTagException{

    if (_shouldLoop == false) {
      return EVAL_PAGE;
    }

    try {
      if (_rset.next() == true) {
        ++_rowCount;
        setTotalRowCount(_rowCount);
        return EVAL_BODY_TAG;
      }
    } catch (SQLException e) {
      throw new JspTagException(e.toString());
    }

    setTotalRowCount(_rowCount);
    return EVAL_PAGE;
  }

  public void release() {
    _statement = null;
    _rset = null;
    _shouldLoop = true;
    _name = null;
    _scope = null;
    _rowCount = 0;
  }

  protected void setTotalRowCount(int rowCount) {
    pageContext.setAttribute("org.apache.taglibs.dbtags.resultset.rowcount",
                              new Integer(rowCount));
  }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕佐山爱一区二区免费| 欧美三级日韩三级国产三级| 亚洲成年人影院| 亚洲天堂中文字幕| 亚洲精品成a人| 亚洲精品国产品国语在线app| 自拍偷拍国产亚洲| 综合久久国产九一剧情麻豆| 亚洲欧洲日韩在线| 亚洲欧洲一区二区三区| 亚洲免费观看高清完整版在线观看熊| 国产精品久久久久影视| 日韩一区在线看| 亚洲精品少妇30p| 亚洲444eee在线观看| 日本不卡的三区四区五区| 蜜桃视频免费观看一区| 国产一区二区美女| 91免费观看视频| 欧美肥大bbwbbw高潮| 精品国精品国产尤物美女| 久久久亚洲精品一区二区三区| 久久久精品日韩欧美| 亚洲欧洲一区二区三区| 日韩在线观看一区二区| 久久精品国产999大香线蕉| 国产成人免费在线视频| 色婷婷综合久久久久中文| 欧美丝袜丝交足nylons图片| 日韩欧美综合在线| 国产精品欧美经典| 日韩在线观看一区二区| 国产精品影视网| 欧美乱妇20p| 中文字幕精品—区二区四季| 午夜精品福利一区二区蜜股av| 久久精品国产99国产精品| 91免费国产视频网站| 精品久久久久一区二区国产| 一区二区免费在线播放| 极品少妇一区二区三区精品视频| 一本大道久久精品懂色aⅴ| 精品美女一区二区三区| 亚洲成av人片在线| 不卡视频在线观看| 精品国产伦理网| 香蕉加勒比综合久久| 丁香婷婷综合五月| 日韩免费看的电影| 亚洲高清免费视频| 972aa.com艺术欧美| 26uuu国产电影一区二区| 午夜精品一区二区三区免费视频 | 国产精品综合网| 欧美做爰猛烈大尺度电影无法无天| 欧美mv和日韩mv国产网站| 亚洲福利视频一区二区| a亚洲天堂av| 国产日韩欧美综合在线| 极品少妇一区二区三区精品视频 | 国产suv精品一区二区6| 日韩欧美亚洲国产精品字幕久久久| 亚洲视频一区在线| 不卡大黄网站免费看| 久久色.com| 国产综合久久久久影院| 日韩一区二区电影| 麻豆视频一区二区| 日韩视频永久免费| 奇米精品一区二区三区在线观看一| 欧美色国产精品| 午夜视频一区在线观看| 欧美顶级少妇做爰| 秋霞午夜av一区二区三区| 91精品欧美一区二区三区综合在 | 亚洲一级二级在线| 日本乱码高清不卡字幕| 亚洲日本乱码在线观看| 91蜜桃网址入口| 亚洲精品美国一| 欧美在线你懂得| 日韩电影在线一区二区| 这里只有精品免费| 蜜乳av一区二区| 久久久精品国产免大香伊| 国产·精品毛片| 亚洲老司机在线| 欧美日韩中字一区| 久久成人免费日本黄色| 国产亚洲综合av| 91网站最新地址| 婷婷成人综合网| 久久精品欧美一区二区三区不卡 | 成人午夜电影网站| 亚洲免费伊人电影| 91精品国产品国语在线不卡| 免费在线观看视频一区| 国产欧美一二三区| 色一区在线观看| 天天影视涩香欲综合网| 精品国产乱码久久久久久老虎| 成人永久免费视频| 五月婷婷久久综合| 欧美精彩视频一区二区三区| 欧洲精品中文字幕| 久久99热这里只有精品| 国产精品美女视频| 在线区一区二视频| 国产成人综合在线播放| 亚洲成人免费影院| 国产午夜精品久久| 欧美精品在线一区二区三区| 国产精品夜夜爽| 亚洲成人av一区二区三区| 久久精品免视看| 51精品久久久久久久蜜臀| 不卡的av电影| 激情五月婷婷综合网| 一区二区三区欧美亚洲| 久久久不卡网国产精品一区| 欧美日韩视频专区在线播放| 成人免费看的视频| 日韩午夜av一区| 久久一夜天堂av一区二区三区 | 一区二区三区国产精品| 91精品国产色综合久久不卡蜜臀| 99视频在线精品| 国产乱人伦偷精品视频免下载 | 日韩一区二区免费在线电影| 91亚洲精品久久久蜜桃| 国产一区二区三区| 日本成人在线一区| 亚洲一区二区三区在线| 国产精品乱码一区二三区小蝌蚪| 日韩视频免费观看高清在线视频| 色婷婷综合久久久久中文一区二区| 国产乱国产乱300精品| 午夜电影一区二区| 亚洲乱码日产精品bd| 国产精品欧美综合在线| 久久久久久毛片| 日韩三级.com| 欧美成人r级一区二区三区| 欧美放荡的少妇| 欧美日韩精品一二三区| 日本道色综合久久| 欧美亚洲尤物久久| 在线亚洲人成电影网站色www| 99精品欧美一区二区蜜桃免费 | 麻豆高清免费国产一区| 日韩美一区二区三区| 欧美卡1卡2卡| 国产精品一区二区三区99| 亚洲精品成人少妇| 亚洲夂夂婷婷色拍ww47| 亚洲丝袜另类动漫二区| 亚洲欧洲精品一区二区三区不卡| 欧美激情一区不卡| 久久久久国产精品厨房| 欧美一区二区三区免费| 日韩欧美中文字幕公布| 日韩免费高清av| 久久夜色精品一区| 久久综合中文字幕| 国产精品欧美一区喷水| 亚洲男人电影天堂| 偷拍日韩校园综合在线| 精品中文字幕一区二区| 国产精品亚洲午夜一区二区三区| 成人午夜激情影院| 欧美性生活大片视频| 欧美一区二区私人影院日本| 精品欧美一区二区三区精品久久 | 成人18精品视频| 色视频欧美一区二区三区| 日本高清无吗v一区| 欧美喷潮久久久xxxxx| 精品久久久久久久久久久久久久久久久| 精品成a人在线观看| 国产精品久久久久久一区二区三区| 亚洲视频网在线直播| 丝袜a∨在线一区二区三区不卡| 精品一区二区三区香蕉蜜桃| 成人黄色综合网站| 欧美精品自拍偷拍动漫精品| 国产免费观看久久| 亚洲高清视频在线| 成人免费高清在线| 日韩免费看网站| 一个色妞综合视频在线观看| 激情都市一区二区| 在线观看日产精品| 久久九九国产精品| 日韩电影在线一区二区三区| 成人精品免费网站| 欧美大片在线观看| 亚洲一二三区不卡| 成人国产精品免费观看视频| 欧美一区二区三区播放老司机| 中文字幕一区免费在线观看|