当前位置: 首页 > news >正文

广西平台网站建设报价/宁波seo网络推广

广西平台网站建设报价,宁波seo网络推广,门户网站模板源码下载,长沙透水地坪这篇文章主要为大家详细介绍了Java实现分页的前台页面和后台代码,具有一定的参考价值,感兴趣的小伙伴们可以参考一下本文实例为大家分享了Java分页展示的具体代码,供大家参考,具体内容如下先上图吧,大致如图&#xff0…

这篇文章主要为大家详细介绍了Java实现分页的前台页面和后台代码,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

本文实例为大家分享了Java分页展示的具体代码,供大家参考,具体内容如下

先上图吧,大致如图,也就提供个思路(ps:使用了SSH框架)

2a77895d3e301ad5925e769bb8143b2a.png

前台JSP页面

pageEncoding="utf-8"%>

数据交易猫

//1分页下,动态添加disable给分页按钮

/*

$(function(){

var myPageId="#"+$("#hidCurrentPage").val();

var myPageAId="#"+$("#hidCurrentPage").val()+" a";

$(myPageAId).addClass('main-bgcolor');

$(myPageAId).attr('href','javascript:void(0)')

$(myPageId).addClass('disabled');

$(myPageId).addClass('disabledControl');

})

*/

//

$(function(){

})

//根据页数查询数据列表

function queryRequirListByPage(i) {

var pageNo=i;

var sortValue=$('#hidSortValue').val();

$.ajax({

url:'${pageContext.request.contextPath}/bid/reAction_queryRequirListByPage.action',

type:'POST',

data:{

sortValue:sortValue,

pageNo:pageNo

},

success:function(datas){

$('#requireContentp').html(datas);

},

error:function(){

alert("失败");

},

});

}

//根据下拉查询数据列表

function selectPage(obj){

var pageNo=obj.options[obj.selectedIndex].value;

var sortValue=$('#hidSortValue').val();

$.ajax({

url:'${pageContext.request.contextPath}/bid/reAction_queryRequirListByPage.action',

type:'POST',

data:{

sortValue:sortValue,

pageNo:pageNo

},

success:function(datas){

$('#requireContentp').html(datas);

},

error:function(){

alert("失败");

},

});

}

//根据下拉选择排序方式

function selectSort(obj){

var sortValue = obj.options[obj.selectedIndex].value;

var pageNo =1;

$.ajax({

url:'${pageContext.request.contextPath}/bid/reAction_queryRequirListByPage.action',

type:'POST',

data:{sortValue:sortValue,

pageNo:pageNo

},

success:function(datas){

$('#requireContentp').html(datas);

},

error:function(){

alert("失败");

},

});

}

$(document).ready(function(){

var backSortValue=$('#backSortValue').val();

console.log("backSortValue"+backSortValue)

$("#category option").each(function(){

var thisId='#'+this.id;

var thisValue=this.value;

if(backSortValue==thisValue){

$(thisId).attr('selected','selected');

}

});

})

需求列表

筛选:按

最新

价格降序


rel="external nofollow" οnclick="reward()">${title}

悬赏积分:${price}

需求描述:${requirementDescription}


  • rel="external nofollow" aria-label="Previous" οnclick="queryRequirListByPage(${currentPage-1})">

    «

  • rel="external nofollow" οnclick="queryRequirListByPage(1)">首页

  • ${currentPage}/ ${allPage}页

  • rel="external nofollow" οnclick="queryRequirListByPage(${allPage})">尾页

  • rel="external nofollow" aria-label="Next" οnclick="queryRequirListByPage(${currentPage+1})">

    »

  • 跳转到第


action//查询需求列表

public String queryRequirListByPage(){

int pageSize=5;//每页记录

String hql="select r from Requirement r where r.reStatus !=2 ";

if(sortValue == null || sortValue.length() <= 0){

hql=hql+"order by r.publishDatetime desc";

ActionContext.getContext().put("sortValue", "publishDatetime"); //当前页码条件

session.put("sessionReqSortValue","publishDatetime");

}else{

hql=hql+"order by r."+sortValue+" desc";

ActionContext.getContext().put("sortValue", sortValue); //当前页码条件

session.put("sessionReqSortValue",sortValue);

}

long icount=requirementService.countAllRe();//总记录数

long allPage;//总页数

//判断是否能整除,能则直接,不能则+1;

if((icount%pageSize)==0){

allPage=icount/pageSize;

}

else{

allPage=(icount/pageSize)+1;

}

System.out.println("总记录:"+icount+";总页数:"+allPage+";当前页码:"+pageNo);

List requiList=requirementService.queryByPage(hql, pageNo, pageSize);

ActionContext.getContext().put("requiList", requiList);//需求列表

ActionContext.getContext().put("icount", icount);//总记录数

ActionContext.getContext().put("allPage", allPage);//总页数

ActionContext.getContext().put("currentPage", pageNo); //当前页码

session.put("sessionCurrentPage", pageNo);

return "requireContent";

}

servicepublic long countAllRe() {

return requirementDao.countAllRe();

}

public List queryByPage(String hql, int pageNo, int pageSize) {

return requirementDao.queryByPage(hql, pageNo, pageSize);

}

dao//这里可能会报错,就是直接查询数据列表(使用了SSH)

public long countAll() {

List> l = getSession().createQuery("select count(*) from "

+ clazz.getSimpleName()).list();

if (l != null && l.size() == 1 )

{

return (Long)l.get(0);

}

return 0;

}

public List queryByPage(String hql, int pageNo, int pageSize) {

return getSession()

.createQuery(hql)

.setFirstResult((pageNo - 1) * pageSize)

.setMaxResults(pageSize)

.list();

}

http://www.lbrq.cn/news/837919.html

相关文章:

  • 辽宁响应式网站费用/淘宝指数官网的网址
  • 网站服务器怎么优化/百度官网优化
  • 网络架构1788/seo刷排名公司
  • 自助 建站/黄山seo
  • 贵州省建设厅考证官方网站/建站公司网站建设
  • 网站线框图怎样做/有没有免费推广平台
  • 网站开发数据库速度解决方法/建网站公司哪里好
  • 调研纪委网站建设/什么是网络营销的核心
  • 金华手机网站建设/站长之家工具高清
  • 单位网站怎么做/如何做网络推广外包
  • 厦门网站关键词推广/百度下载安装2021最新版
  • 中国哪些网站做软装/深圳seo关键词优化外包公司
  • 建设网站架构服务器需要多少钱/怎么去做推广
  • 南阳做网站公司电话/广告联盟看广告赚钱
  • 哪家网站做旅游攻略好/上海百度竞价
  • 站长工具seo综合查询排名/seo网页优化培训
  • 著名的设计网站/杭州seo整站优化
  • 做游戏的网站的公司/百度官方网首页
  • sap和国家网站做接口/seo职业技能培训班
  • 智联招聘网站怎么做两份简历模板/中山seo排名
  • 做受免费网站/西安百度关键词推广
  • 做美妆的网站/网站推广的四个阶段
  • 推广网站利润/google浏览器下载安装
  • 如何让自己的网站排名靠前/全国疫情实时资讯
  • 网站gif小图标/怎么自己制作一个网站
  • 建站平台是给谁用的/网络营销策略主要包括
  • 公众号开发信息开发者密码是什么/电子商务seo是什么意思
  • 在那个网站做直播好赚钱吗/谷歌搜索入口
  • tplink虚拟服务器做网站/公司运营策划方案
  • 专业网站建设微信网站定制/做一个电商平台大概需要多少钱
  • 第2章通用的高并发架构设计——2.5 高并发读场景总结:CQRS
  • ota之.加密算法,mcu加密方式
  • 性能优化实践:Modbus 在高并发场景下的吞吐量提升(二)
  • PDF 转 Word 支持加密的PDF文件转换 批量转换 编辑排版自由
  • FCN语义分割笔记(1)
  • 【LLM】OpenRouter调用Anthropic Claude上下文缓存处理