java.lang.NumberFormatException: For input string: "2;"

dingfengwei 2012-12-17 04:12:48
最近在写jsp分页显示老出错 恳请高手指教


<%//变量声明
int intPageSize; //一页显示的记录数
int intRowCount; //记录总数
int intPageCount; //总页数
int intPage; //待显示页码
String strPage;

//设置一页显示的记录数
intPageSize =2;
//取得待显示页码
strPage= request.getParameter("page");
if(strPage==null){//表明在QueryString中没有page这一个参数,此时显示第一页数据
intPage = 1;
}
else{//将字符串转换成整型
intPage =Integer.parseInt(strPage);
if(intPage<1) {intPage = 1; }
}
%>
.....
.....
<form method="POST" action="">
<div align="center">共<%=intRowCount %>条 第<%=intPage%>页 共<%=intPageCount%>页

<%if(intPage<intPageCount){%>
<a href="in.jsp?page=<%=intPage+1%>;" class="STYLE1">下一页</a>
<%}%>
<%if(intPage>1){%>
<a href="in.jsp?page=<%=intPage-1%>;" class="STYLE1">上一页</a>
<%}%>
转到第:<select name="page" onChange="submit()">
<%
for(int j=1;j<=intPageCount;j++){
if(j==intPage)
out.print("<option value='"+j+"' selected>"+j+"</option>");
else
out.print("<option value='"+j+"'>"+j+"</option>");
}

%>
</select>页
</div>
</form>

在点下一页时出现错误java.lang.NumberFormatException: For input string: "2;"

恳请各位高手指教
...全文
406 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
dingfengwei 2012-12-18
  • 打赏
  • 举报
回复
谢谢 怎么给分
jeff_jiang 2012-12-17
  • 打赏
  • 举报
回复
引用 6 楼 q2979978 的回复:
<%if(intPage<intPageCount){%> <a href="in.jsp?page=<%=intPage+1%>;" class="STYLE1">下一页</a> <%}%> <%if(intPage>1){%> <a……
分号- -/。。
jeff_jiang 2012-12-17
  • 打赏
  • 举报
回复
<%if(intPage<intPageCount){%> <a href="in.jsp?page=<%=intPage+1%>;" class="STYLE1">下一页</a> <%}%> <%if(intPage>1){%> <a href="in.jsp?page=<%=intPage-1%>;" class="STYLE1">上一页</a> <%}%> 这两个冒号去掉。
dingfengwei 2012-12-17
  • 打赏
  • 举报
回复
我用的是myeclipse
dingfengwei 2012-12-17
  • 打赏
  • 举报
回复
哪里多个冒号呢??
任第一 2012-12-17
  • 打赏
  • 举报
回复
用火狐--》firebug调试。
任第一 2012-12-17
  • 打赏
  • 举报
回复
用火狐--》firebug调试。
e9876 2012-12-17
  • 打赏
  • 举报
回复
明显多了个冒号。。

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧