⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 page_tag.java

📁 JSP+Servlet+JavaBean+标签文件写的分页标签!
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
package org.apache.jsp.tag.web;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class Page_tag
    extends javax.servlet.jsp.tagext.SimpleTagSupport
    implements org.apache.jasper.runtime.JspSourceDependent {


  private static java.util.Vector _jspx_dependants;

  private JspContext jspContext;
  private java.io.Writer _jspx_sout;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_set_value_target_property_nobody;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_if_test;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_forTokens_var_items_delims;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_forEach_var_items;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_choose;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_when_test;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_otherwise;
  private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_forEach_var_step_end_begin;

  public void setJspContext(JspContext ctx) {
    super.setJspContext(ctx);
    java.util.ArrayList _jspx_nested = null;
    java.util.ArrayList _jspx_at_begin = null;
    java.util.ArrayList _jspx_at_end = null;
    this.jspContext = new org.apache.jasper.runtime.JspContextWrapper(ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, null);
  }

  public JspContext getJspContext() {
    return this.jspContext;
  }
  private java.lang.String tableName;
  private java.lang.String columnNames;
  private java.lang.String rowsPerPage;
  private java.lang.String primaryKey;
  private java.lang.String location;
  private java.lang.String titles;
  private java.lang.String width;
  private java.lang.String align;

  public java.lang.String getTableName() {
    return this.tableName;
  }

  public void setTableName(java.lang.String tableName) {
    this.tableName = tableName;
  }

  public java.lang.String getColumnNames() {
    return this.columnNames;
  }

  public void setColumnNames(java.lang.String columnNames) {
    this.columnNames = columnNames;
  }

  public java.lang.String getRowsPerPage() {
    return this.rowsPerPage;
  }

  public void setRowsPerPage(java.lang.String rowsPerPage) {
    this.rowsPerPage = rowsPerPage;
  }

  public java.lang.String getPrimaryKey() {
    return this.primaryKey;
  }

  public void setPrimaryKey(java.lang.String primaryKey) {
    this.primaryKey = primaryKey;
  }

  public java.lang.String getLocation() {
    return this.location;
  }

  public void setLocation(java.lang.String location) {
    this.location = location;
  }

  public java.lang.String getTitles() {
    return this.titles;
  }

  public void setTitles(java.lang.String titles) {
    this.titles = titles;
  }

  public java.lang.String getWidth() {
    return this.width;
  }

  public void setWidth(java.lang.String width) {
    this.width = width;
  }

  public java.lang.String getAlign() {
    return this.align;
  }

  public void setAlign(java.lang.String align) {
    this.align = align;
  }

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  private void _jspInit(ServletConfig config) {
    _jspx_tagPool_c_set_value_target_property_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(config);
    _jspx_tagPool_c_if_test = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(config);
    _jspx_tagPool_c_forTokens_var_items_delims = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(config);
    _jspx_tagPool_c_forEach_var_items = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(config);
    _jspx_tagPool_c_choose = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(config);
    _jspx_tagPool_c_when_test = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(config);
    _jspx_tagPool_c_otherwise = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(config);
    _jspx_tagPool_c_forEach_var_step_end_begin = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(config);
  }

  public void _jspDestroy() {
    _jspx_tagPool_c_set_value_target_property_nobody.release();
    _jspx_tagPool_c_if_test.release();
    _jspx_tagPool_c_forTokens_var_items_delims.release();
    _jspx_tagPool_c_forEach_var_items.release();
    _jspx_tagPool_c_choose.release();
    _jspx_tagPool_c_when_test.release();
    _jspx_tagPool_c_otherwise.release();
    _jspx_tagPool_c_forEach_var_step_end_begin.release();
  }

  public void doTag() throws JspException, java.io.IOException {
    PageContext _jspx_page_context = (PageContext)jspContext;
    HttpServletRequest request = (HttpServletRequest) _jspx_page_context.getRequest();
    HttpServletResponse response = (HttpServletResponse) _jspx_page_context.getResponse();
    HttpSession session = _jspx_page_context.getSession();
    ServletContext application = _jspx_page_context.getServletContext();
    ServletConfig config = _jspx_page_context.getServletConfig();
    JspWriter out = jspContext.getOut();
    _jspInit(config);
    if( getTableName() != null ) 
      _jspx_page_context.setAttribute("tableName", getTableName());
    if( getColumnNames() != null ) 
      _jspx_page_context.setAttribute("columnNames", getColumnNames());
    if( getRowsPerPage() != null ) 
      _jspx_page_context.setAttribute("rowsPerPage", getRowsPerPage());
    if( getPrimaryKey() != null ) 
      _jspx_page_context.setAttribute("primaryKey", getPrimaryKey());
    if( getLocation() != null ) 
      _jspx_page_context.setAttribute("location", getLocation());
    if( getTitles() != null ) 
      _jspx_page_context.setAttribute("titles", getTitles());
    if( getWidth() != null ) 
      _jspx_page_context.setAttribute("width", getWidth());
    if( getAlign() != null ) 
      _jspx_page_context.setAttribute("align", getAlign());

    try {
      out.write("\n\n <!-- 表名 -->\n <!-- 列名 -->\n <!-- 每页显示的行数 -->\n  <!-- 主键字段 -->\n  <!-- 重定向的页面 -->\n  <!-- 表头 -->\n   <!-- 表格宽度 -->\n   <!-- 对齐方式 -->\n");
      page.PageBean page2 = null;
      synchronized (request) {
        page2 = (page.PageBean) _jspx_page_context.getAttribute("page2", PageContext.REQUEST_SCOPE);
        if (page2 == null){
          page2 = new page.PageBean();
          _jspx_page_context.setAttribute("page2", page2, PageContext.REQUEST_SCOPE);
        }
      }
      out.write("\n\n<!-- 将value的值储存至target对象的属性中 -->\n");
      if (_jspx_meth_c_set_0(_jspx_page_context))
        return;
      out.write('\n');
      if (_jspx_meth_c_set_1(_jspx_page_context))
        return;
      out.write('\n');
      if (_jspx_meth_c_set_2(_jspx_page_context))
        return;
      out.write('\n');
      if (_jspx_meth_c_set_3(_jspx_page_context))
        return;
      out.write("\n\n<script type=\"text/javascript\">\n   <!--\n     function Jumping()\n     {\n       document.PageForm.submit();\n       return;\n     }\n     function gotoPage(pagenum)\n     {\n       document.PageForm.jumpPage.value = pagenum;\n       document.PageForm.submit();\n       return;\n     }\n   -->\n</script>\n\n<table border=\"1\" align=\"");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${align}", java.lang.String.class, (PageContext)this.getJspContext(), null, false));
      out.write("\" width=\"");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${width}", java.lang.String.class, (PageContext)this.getJspContext(), null, false));
      out.write("\">\n    <!-- 判断是否有表头属性,如果有则输出表头 -->\n    ");
      if (_jspx_meth_c_if_0(_jspx_page_context))
        return;
      out.write("\n    <!-- 显示本页的数据 -->\n    ");
      if (_jspx_meth_c_forEach_0(_jspx_page_context))
        return;
      out.write("\n</table>\n\n<div align=\"");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${align}", java.lang.String.class, (PageContext)this.getJspContext(), null, false));
      out.write("\">\n   <!-- 判断总页数是否多于1页 -->\n   ");
      if (_jspx_meth_c_if_1(_jspx_page_context))
        return;
      out.write("\n</div>\n");
    } catch( Throwable t ) {
      if( t instanceof SkipPageException )
          throw (SkipPageException) t;
      if( t instanceof java.io.IOException )
          throw (java.io.IOException) t;
      if( t instanceof IllegalStateException )
          throw (IllegalStateException) t;
      if( t instanceof JspException )
          throw (JspException) t;
      throw new JspException(t);
    } finally {
      ((org.apache.jasper.runtime.JspContextWrapper) jspContext).syncEndTagFile();
      _jspDestroy();
    }
  }

  private boolean _jspx_meth_c_set_0(PageContext _jspx_page_context)
          throws Throwable {
    JspWriter out = _jspx_page_context.getOut();
    //  c:set
    org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_set_0 = (org.apache.taglibs.standard.tag.rt.core.SetTag) _jspx_tagPool_c_set_value_target_property_nobody.get(org.apache.taglibs.standard.tag.rt.core.SetTag.class);
    _jspx_th_c_set_0.setPageContext(_jspx_page_context);
    _jspx_th_c_set_0.setParent(null);
    _jspx_th_c_set_0.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${tableName}", java.lang.Object.class, (PageContext)this.getJspContext(), null, false));
    _jspx_th_c_set_0.setTarget((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${page2}", java.lang.Object.class, (PageContext)this.getJspContext(), null, false));
    _jspx_th_c_set_0.setProperty("tableName");
    int _jspx_eval_c_set_0 = _jspx_th_c_set_0.doStartTag();
    if (_jspx_th_c_set_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      throw new SkipPageException();
    _jspx_tagPool_c_set_value_target_property_nobody.reuse(_jspx_th_c_set_0);
    return false;
  }

  private boolean _jspx_meth_c_set_1(PageContext _jspx_page_context)
          throws Throwable {
    JspWriter out = _jspx_page_context.getOut();
    //  c:set
    org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_set_1 = (org.apache.taglibs.standard.tag.rt.core.SetTag) _jspx_tagPool_c_set_value_target_property_nobody.get(org.apache.taglibs.standard.tag.rt.core.SetTag.class);
    _jspx_th_c_set_1.setPageContext(_jspx_page_context);
    _jspx_th_c_set_1.setParent(null);
    _jspx_th_c_set_1.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${columnNames}", java.lang.Object.class, (PageContext)this.getJspContext(), null, false));
    _jspx_th_c_set_1.setTarget((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${page2}", java.lang.Object.class, (PageContext)this.getJspContext(), null, false));
    _jspx_th_c_set_1.setProperty("columnNames");
    int _jspx_eval_c_set_1 = _jspx_th_c_set_1.doStartTag();
    if (_jspx_th_c_set_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE)
      throw new SkipPageException();
    _jspx_tagPool_c_set_value_target_property_nobody.reuse(_jspx_th_c_set_1);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -