亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么點擊下一頁就出錯

為什么點擊下一頁就出錯

楓夜流螢 2017-12-29 20:04:23
<%@?page?language="java"?pageEncoding="UTF-8"%> <%@?page?import="java.util.*"%>//下面這些是導包和javabean <%@?page?import="Bean.PersoninfoForm"%> <jsp:useBean?id="FyeBean" ?class="Dao.FenyeAction"?scope="page"></jsp:useBean> <!DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN"> <html:html?locale="true"> <head> ?<html:base?/> ?<title>查詢</title> ?<meta?http-equiv="pragma"?content="no-cache"> ?<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> <body> ? ?<% ??//變量聲明? ??int?intPageSize;?//一頁顯示的記錄數? ??int?intRowCount;?//記錄總數? ??int?intPageCount;?//總頁數? ??int?intPage;?//待顯示頁碼? ??java.lang.String?strPage; ??int?i; ??//設置一頁顯示的記錄數? ??intPageSize?=?4; ??//取得待顯示頁碼? ??strPage?=?request.getParameter("page"); ??if?(strPage?==?null)?{//表明在QueryString中沒有page這一個參數,此時顯示第一頁數據? ???intPage?=?1; ??}?else?{//將字符串轉換成整型? ???intPage?=?java.lang.Integer.parseInt(strPage); ???if?(intPage?<?1) ????intPage?=?1; ??} ??intRowCount?=?FyeBean.count();//獲得總記錄數。用javabean調用了FenyeAction中的方法,得到總記錄數,? ??//記算總頁數? ??intPageCount?=?(intRowCount?+?intPageSize?-?1)?/?intPageSize; ??//調整待顯示的頁碼,如果大于總頁數就等于總頁數? ??if?(intPage?>?intPageCount) ???intPage?=?intPageCount; ?%> ?<form?method="POST"?action="chaxun.jsp"> ??<p> ???第 ???<%=intPage%> ???頁?共 ???<%=intPageCount%> ???頁 ??? ???<% ??if?(intPage?<?intPageCount)?{ ??%> ???<a?href="chaxun.jsp?page=<%=intPage?+?1%>">下一頁?</a> ???<% ???} ???%> ???<% ???if?(intPage?>?1)?{ ???%> ???<a?href="chaxun.jsp?page=<%=intPage?-?1%>">?上一頁</a> ???<% ???} ???%> ???轉到第: ???<input?type="text"?name="page"?size="8"> ???頁 ???<span>?<input?class=buttonface?type="submit"?value="GO" ?????name="cndok">?</span> ??</p> ??<table?width="169"?border="1"?cellpadding="0"?cellspacing="0"> ???<tr> ????<th?width="28"> ?????車牌 ????</th> ????<th?width="82"> ?????車型 ????</th> ????<th?width="51"?> ?????狀態 ????</th> ????<th?width="51"?> ?????用戶 ????</th> ????<th?width="51"?> ?????日期 ????</th> ????<th?width="51"?> ?????產地 ????</th> ???</tr> ???<% ???//查詢數據庫,獲得記錄數據 ???Collection?c; ???PersoninfoForm?psinfo; ???c?=?FyeBean.fenye(); ???Object?o[]?=?c.toArray(); ??? ???System.out.println(intPage);//測試用 ???System.out.println(intPageSize); ???System.out.println(intPageCount); ???int?start?=?(intPage?-?1)?*?(intPageSize); ???int?end?=?(intPage?-?1)?*?(intPageSize)?+?intPageSize; ???int?j; ????for?(j?=?start;?j?<?end;?j++)?{ ?????psinfo?=?(PersoninfoForm)?o[j]; ?????String?busNum?=?psinfo.getBusNum(); ?????String?busType?=?psinfo.getBusType(); ?????String?busStatus?=?psinfo.getBusStatus(); ?????String?busUser?=?psinfo.getBusUser(); ?????String?busDate?=?psinfo.getBusDate(); ?????String?busPlace?=?psinfo.getBusPlace(); ???%> ???<tr> ????<td> ?????<%=busNum%> ????</td> ????<td> ?????<%=busType%> ????</td> ????<td> ?????<%=busStatus%> ????</td> ????<td> ?????<%=busUser%> ????</td> ????<td> ?????<%=busDate%> ????</td> ????<td> ?????<%=busPlace%> ????</td> ???</tr> ???<% ???} ???%> ??</table> ?</form> </body> </html:html>
查看完整描述

1 回答

?
黃沛元

TA貢獻23條經驗 獲得超5個贊

你復制這代碼上來有什么用,一不能運行,二人家看了那么多類更本不知道干嘛的。報錯你就應該把錯誤響應的信息貼出來。

查看完整回答
反對 回復 2018-01-01
  • 1 回答
  • 0 關注
  • 1283 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號