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之上 ......
步骤一:编辑Tomcat的配置文件conf/server.xml在用于接受客户端语法的Connector<connector></connector>标签中添加URIEncoding="UTF-8"属性,该属性用来解决GET中的编码问题。
xml 代码
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" / ......
JSP基本语法
大部分JSP被一个以“<%” 开头和以“%>”结尾的的标记括在其中。在更新的JSP 1.1规范出台后,就有了与XML兼容的版本。
JSP指令和脚本元素
Directives <%@ directive %>
Declarations <%! declaration %>
Expressions <%= expression %>
Code Fragment/ ......
JSP九种内置对像,不用定义可直接使用:request,请求对象;response,响应对象;pageContext,页面上下文对象;session,会话对象;application,应用程序对象;out,输出对象;config,配置对象;page,页面对象;exception,例外对象。
......