Your ROOT_URL in app.ini is http://git.zky.com/ but you are visiting http://61.178.84.89:8998/luoluo/zhky/src/commit/fbc11cb6fa436feeb9ee3fc18c722606b88efe66/web/WEB-INF/classes/com/zky/util/%E5%88%86%E9%A1%B5%E6%9F%A5%E8%AF%A2.txt You should set ROOT_URL correctly, otherwise the web may not work correctly.
zhky/web/WEB-INF/classes/com/zky/util/分页查询.txt

18 lines
1.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

java:
//查询sql
String sql = "select * from tab_department_bak where depttypeid=?";
//实例化一个分页查询对象
//方法一传入参数JDBCPageQuery对象和HttpServletRequest对象
PageQuery pageQuery = new PageQuery(new JDBCPageQuery(conn,sql,"10",new HashFmlBufResultSetHandler()),request);
//方法二:
PageQuery pageQuery = new PageQuery(conn,sql,'10',new HashFmlBufResultHandler(),request);
//获得查询结果query方法的传入参数50为每页显示的记录数
HashFmlBuf buf = (HashFmlBuf)pageQuery.query(50);
jsp:
包含auth.jsp页面或者在页面中加入标签引入代码<%@ taglib uri="/WEB-INF/tlds/PageLinkTag.xml" prefix="tag"%>
在查询结果的表格下方加入分页标签代码:<tag:PageLinkTag operate="query" scope="request" width="90%" align="center"/>
其中 operate:查询调用的servlet中的方法名称(optional, default="query");
scope:="request"(required);
width:分页表签的宽度(optional, default="90%");
align:分页标签的对齐方式(optional, default="left");