jsp 简单分页
//总记录数
int count = personDao.getCount();
//每页显示5条
int pageSize = 5;
//当前页
int currentPage = 1;
int pageCount = (count + pageSize - 1) / pageSize;
String _currentPgae = request.getParameter("currentPage");
if (_currentPgae != null) {
currentPage = Integer.parseInt(_currentPgae);
}
if (currentPage < 1) {
currentPage = 1;
}
if (currentPage > pageCount)
currentPage = pageCount;
List list = personDao.getPageList((currentPage - 1) * pageSize,
pageSize);
Iterator it = list.iterator();
&
相关文档:
http://hi.baidu.com/shedewang/blog/item/b4a71b254e43ce35c895599b.html
说是支持1亿pv/天,也许有点夸张,但如果您能认真看完相信也不会让您失望。
如果大家真想支持我、支持中国人开源项目,请把该文贴到自己的博客中或者收藏本文,记得包含文档的下载地址!!!!!!!谢谢。
我说的系统主要是构建在hibernate之上 ......
今天在如下代码中:
********************************************************
<p><font color="blue">操作步骤:1、选择输出可选项 2、查询 3、输出
<br>
************************************************** ......
1.request对象
客户端的请求信息被封装在request对象中,通过它才能了解到客户的需求,然后做出响应。它是HttpServletRequest类的实例。
序号 方 法 说 明
1 object getAttribute(String name) 返回指定属性的属性值
2 Enumeration getAttributeNames() 返回所有可用属性名的枚举
3 String getCharacterEncoding( ......
JSP九种内置对像,不用定义可直接使用:request,请求对象;response,响应对象;pageContext,页面上下文对象;session,会话对象;application,应用程序对象;out,输出对象;config,配置对象;page,页面对象;exception,例外对象。
......