记事本

order by seqno nulls last--空滞后--


//分页自定义标签
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

import org.apache.struts.util.RequestUtils;

import com.vanceinfo.user.vo.Pagination;

public class PageTag extends TagSupport {
private String name;
private String property;
private String scope;
private String method;
private String zone;

public int doStartTag() throws JspException {

JspWriter out = pageContext.getOut();
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
Pagination page = (Pagination) RequestUtils.lookup(super.pageContext, name, property, scope);
int pageNo = page.getPageNo();
int totalPage = page.getTotalPage();
int count = page.getCount();
int prePage = page.getPrePage();
int nextPage = page.getNextPage();
int pageSize = page.getPageSize();
try {
out.println("共" + totalPage + "页 ");
out.println("当前为第" + pageNo + "页 ");
out.println("总记录为" + count + "条 ");
out.println("<a href='javascript:getPagination(" + prePage + "," + pageSize + ")'>上一页</a> ");
out.println("<a href='javascript:getPagination(" + nextPage + "," + pageSize + ")'>下一页</a> ");
out.println("<a href='javascript:getPagination(1," + pageSize + ")'>首页</a> ");
out.println("<a href='javascript:getPagination(" + totalPage + "," + pageSize + ")'>尾页</a> ");
out.println("<input type='hidden' name='ps' value='"+pageSize+"'/>\n<input type='hidden' name='pn' value='"+pageNo+"'/>");
out.println(
"\n<script>\n"
+ "function getPagination(pageNo,pageSize){\n"
+ "document.getElementById('pn').value=pageNo;\n"
+ "document.getElementById('ps').value=pageSize;\n"
+ "ajaxAnywhere.submitAJAX('"
+ method
+ "','"
+ zone
+ "');\n"
+ "}\n"
+ "</script>\n");
} catch (Exception e) {
e.printStackTrace();
throw new JspTagException ("IOException:" + e.toString());
}
return super.doStartTag();
}

public String getName() {
return name;
}

public String getProperty() {
return property;
}


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


public void setProperty(String string) {
property = string;
}


public String getScope() {
return scope;
}


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


public String getMethod() {
return method;
}


public String getZone() {
return zone;
}


public void setMethod(String string) {
method = string;
}


public void setZone(String string) {
zone = string;
}

}

<page:pageTag name="userForm" property="page" method="getUserInfo" zone="sResult,editZone"/>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值