日期:2014-05-18  浏览次数:20732 次

谁有struts+hibernate的分页代码啊?救命啊!!
谁有struts+hibernate的分页代码啊?救命啊!!可以发到我的邮箱去xnang@163.com

------解决方案--------------------
各位高手我刚接触jboss4,为什么我的jboss4启动后有这样的提示“LifecycleException:protocol handler start failed:java.io.FileNotFountException:D:\jboss4\server\helloworld\conf\chap8.keystore <系统找不到指定文件> ,我请教各位高手!这个问题整了好几天了,是不是JBOSS配置的问题,但是哪的问题!谢谢各位!
------解决方案--------------------
struts不是自带有serveTable.do分页的吗,而且很好用
------解决方案--------------------
首先创建3个类page,PageHelper,PubFunc,源码如下:
package com.jetsoft.util;

public class page {
private int perPage = 10;// 默认的分页长度

private int page = 1; // 默认显示为第一页

private int total = 0;//记录总长度

private int startRs = 0;//总页数

private String url = " ";// 跳转的路径

private String param = " ";// 参数

private String hql; // 分页的hql语句

public page() {
}

public page(int perPage,int ipage,int total,String hql,String url,String param){
this.perPage=perPage;
this.page=ipage;
this.total=total;
this.startRs=(ipage - 1) * perPage;
this.hql=hql;
this.url=url;
this.param=param;
}
/**
* @return 返回 hql。
*/
public String getHql() {
return hql;
}

/**
* @param hql
* 要设置的 hql。
*/
public void setHql(String hql) {
this.hql = hql;
}

/**
* @return 返回 page。
*/
public int getPage() {
return page;
}

/**
* @param page
* 要设置的 page。
*/
public void setPage(int page) {
this.page = page;
}

/**
* @return 返回 param。
*/
public String getParam() {
return param;
}

/**
* @param param
* 要设置的 param。
*/
public void setParam(String param) {
this.param = param;
}

/**
* @return 返回 perPage。
*/
public int getPerPage() {
return perPage;
}

/**
* @param perPage
* 要设置的 perPage。
*/
public void setPerPage(int perPage) {
this.perPage = perPage;
}

/**
* @return 返回 startRs。
*/
public int getStartRs() {
return startRs;
}

/**
* @param startRs
* 要设置的 startRs。
*/
public void setStartRs(int startRs) {
this.startRs = startRs;
}

/**
* @return 返回 total。
*/
public int getTotal() {
return total;
}

/**
* @param total
* 要设置的 total。
*/
public void setTotal(int total) {
this.total = total;
}

/**
* @return 返回 url。
*/
public String getUrl() {
return url;
}

/**
* @param url
* 要设置的 url。
*/
public void setUrl(String url) {
this.url = url;
}
}