JSP_网上搜集的分页及example搜索相关代码(7)
发布时间:2021-06-07
发布时间:2021-06-07
}
}
}
}
} 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){
上一篇:独放的生命