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();
&
相关文档:
一、JSP页面显示乱码
二、表单提交中文时出现乱码
三、数据库连接
大家在JSP的开发过程中,经常出现中文乱码的问题,可能一至困扰着您,我现在把我在JSP开发中遇到
的中文乱码的问题及解决办法写出来供大家参考。
一、JSP页面显示乱码
下面的显示页面(display.jsp)就出现乱码:
<html>
<head>
<tit ......
今天在如下代码中:
********************************************************
<p><font color="blue">操作步骤:1、选择输出可选项 2、查询 3、输出
<br>
************************************************** ......
JSP九种内置对像,不用定义可直接使用:request,请求对象;response,响应对象;pageContext,页面上下文对象;session,会话对象;application,应用程序对象;out,输出对象;config,配置对象;page,页面对象;exception,例外对象。
......
1、一、先提条件: 在web.xml中加以下语句(原因参考RESIN官方文档)
<servlet>
<servlet-name>SSIServlet</servlet-name>
<servlet-class>com.caucho.servlets.ssi.SS ......