firstpage.java

来自「这个是一个网站的简单源码」· Java 代码 · 共 55 行

JAVA
55
字号
package com.jewel.tag.pagination;

import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.TagSupport;
/**
 * <p>Title: www.entel.com.cn</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: entel</p>
 * @author chendesheng
 * @version 1.0
 */

public class FirstPage extends TagSupport implements PagerInterface {
  protected String offset = "0";
  protected String length = "10";

  public int doStartTag() throws JspException {
    Common comm = new Common((HttpServletRequest) pageContext.getRequest());
    this.setLength(""+comm.pageLength);
    String out = comm.generateOffSet(getOffset(),comm.First);
    write(out);
    return SKIP_BODY;
  }

  private void write(String param) throws JspException {
    try {
      pageContext.getOut().write(param);
    } catch (IOException oe) {
      throw new JspTagException("IOException while writing to the Client: " +
                                oe.getMessage());
    }
  }

  public String toString() {
    String result = "";
    return result;
  }
  public String getLength() {
    return length;
  }
  public void setLength(String length) {
    this.length = length;
  }
  public void setOffset(String offset) {
    this.offset = offset;
  }
  public String getOffset() {
    return offset;
  }
}

⌨️ 快捷键说明

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