自定义标签(2)

xxx.java

 

public class PaginationTag extends TagSupport {

 private String page_obj;
 /**
  * The form name in which the pagination scripts reside.
  */
 protected String name = null;
 /**
  * The HTML FORM name.
  * If it is missing, the default vaule is as the same as name attribute.
  */
 protected String formName = null;
 /**
  * The query method of the action.
  */
 protected String actionMethod = null;
 /**
  * actionMethod只能接受固定的方法名,这个变量动态的从form中读取分页的查询方法。
  * 特别适用于导航树的分页。  -- 2005-09-28
  */
 protected String isDynamicMethod = null;
 /**
  * The current page num.
  */
 protected String currentPage = null;
 /**
  * The totalPage num.
  */
 protected String totalPage = null;
 /**
  * The request page num.
  */
 protected String requestPage = null;
 /**
  * The total record num.
  */
 protected String totalRecord = null;

 /**
  * javascript function
  */
 protected String onClick = null;

 

public int doStartTag() throws JspException {

  lookup();
  //System.err.print("\n name and page_obj " + "\n" + name + "\t page_obj \n");
  //System.err.print("\n  actionMethod :" + actionMethod + "\n");
    Page page_vo = ((Page)RequestUtils.lookup(pageContext, name, page_obj, null));
    //System.err.println("aaaaaaaaaa=="+pageContext.toString());
//    System.err.println(RequestUtils.message(super.pageContext, null, null, "air.first.page"));
//    System.err.println(CommTools.getValueFromPropertiesKey("air.first.page", super.pageContext));
  //pageContext.findAttribute(name) // get form - bean!
  //PropertyUtils.getProperty(bean, property); // get property!
  //int iCurrentPage = page_vo.
  //*
  int iTotalPage = page_vo.getTotalPage();   
  int iRequestPage = page_vo.getRequestPage();  
  //int iCurrentPage = page_vo.getCurrentPage();   
  int iTotalRecord = page_vo.getTotalRecord();
  int iPageSize = page_vo.getPAGE_SIZE();

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值