qiantai
function gotoPage2(value) { var form = pageform2; form.curPage.value = value; form.submit();}</SCRIPT>
<TD width="21%">
<DIV align=right>
<IMG style="CURSOR: hand" onclick="gotoPage2(1)" border=0 alt=首页
align=absMiddle src="../image/fp_d.jpg">
<IMG style="CURSOR: hand" onclick="gotoPage2(${curPage-1})" border=0 alt=上一页
align=absMiddle src="../image/pp_d.jpg">
<IMG style="CURSOR: hand" onclick="gotoPage2(${curPage+1})" border=0 alt=下一页
align=absMiddle src="../image/np_d.jpg">
<IMG style="CURSOR: hand" onclick="gotoPage2(${pageCount})" border=0 alt=尾页
align=absMiddle src="../image/lp_d.jpg">
</DIV>
</TD>
<INPUT type=hidden name=isAscOrDesc>
<DIV align=right>
共${pageCount}页 第
<SELECT onchange=javascript:gotoPage2(this.value) name=pageList>
<OPTION selected value=1>
<s:bean name="org.apache.struts2.util.Counter" id="counter">
<s:param name="first" value="1" />
<s:param name="last" value="pageCount" />
<s:iterator>
<s:set name="temp" value="current-1" />
<s:if test="(current-1)==curPage">
<option selected="selected" value='<s:property value="#attr.temp"/>'>
<s:property value="#attr.temp" />
</option>
</s:if>
<s:else>
<option value='<s:property value="#attr.temp"/>'>
<s:property value="#attr.temp" />
</option>
</s:else>
</s:iterator>
</s:bean>
</select>
页
</DIV>
</TD>
</FORM>
*
*/
public class PageAction extends ActionSupport{
private int curPage=1;
//当前页
private int page=1;
private int pageCount;
//总页数
private int perPageCount=13;
//每页显示的记录数目
private String searchKeyOrder;
//查询类型
private String searchValueOrder;
//查询条件
private String searchValue;//查询条件的值
private String countHql="";
//查询记录总数hql语句
private String listHql="";
//查询记录hql语句
public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}
private List list;
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getPerPageCount() {
return perPageCount;
}
public void setPerPageCount(int perPageCount) {
this.perPageCount = perPageCount;
}
public int getPageCount() {
return pageCount;
}
public void setPageCount(int count) {
this.pageCount = (count%13)==0?(count/13):(count/13+1);
}
public int getCurPage() {
if(this.curPage-1>=this.pageCount){
this.curPage=this.pageCount;
}
if(this.curPage-1<=0){
this.curPage=1;
}
return curPage;
}
public void setCurPage(int curPage) {
System.out.println("调用设置页码方法");
this.curPage = curPage;
}
public String getSearchKeyOrder() {
return searchKeyOrder;
}
public void setSearchKeyOrder(String searchKeyOrder) {
this.searchKeyOrder = searchKeyOrder;
}
public String getSearchValueOrder() {
return searchValueOrder;
}
public void setSearchValueOrder(String searchValueOrder) {
this.searchValueOrder = searchValueOrder;
}
public List getList() {
return list;
}
public void setList(List list) {
this.list = list;
}
/**
* 收件箱分页
* @return
*/
public String smsReceived(){
//
System.out.println("查找类型:"+this.searchKeyOrder);
//
System.out.println("查找内容:"+this.searchValueOrder);
//
System.out.println("当前页:"+this.getCurPage());
//统计总记录数目
int count=Factory.createDaoFactory().createDaoTemplateDao().count("select count(*) from TblSmreceived as rec where (rec.droped=0 or rec.droped=null)");
//总页数
this.setPageCount(count);
list=Factory.createServiceFacotry().createSMSendTaskService().rec((this.getCurPage()-1)*this.getPerPageCount(), this.getPerPageCount());
return SUCCESS;
}