手机版

JSP_网上搜集的分页及example搜索相关代码(7)

时间:2025-04-29   来源:未知    
字号:

}

}

}

}

} catch (SQLException e) {

// TODO Auto-generated catch block e.printStackTrace();

return bookList;

4. JSP 页面代码:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <jsp:directive.page import="com.book.pagin.BookPaginQuery"/> <jsp:directive.page import="com.book.entity.Book"/>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>

<title>图书信息</title> <meta http-equiv="pragma" content="no-cache"> <body> <%

request.setCharacterEncoding("UTF-8"); //设置编码集

String strPageNum = request.getParameter("pageNum"); //获得当前<meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0">

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!--

<link rel="stylesheet" type="text/css" href="styles.css"> -->

</head>

页数的字符串

int pageNum = 1;

//把当前页数的字符串转化为数字,如果转化失败,则设置当前页数为 1 ,即首页

try{ }

pageNum = Integer.parseInt(strPageNum); pageNum = 1; } catch (Exception e){

JSP_网上搜集的分页及example搜索相关代码(7).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
×
二维码
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)