java Integer.parseInt错误

typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatprevent... type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /adoadd.jsp at line 30

27: <%String uname=request.getParameter("uname");
28: String upass=request.getParameter("upass");
29: String uagestr=request.getParameter("uage");
30: int uage=Integer.parseInt("uagestr");
31: String uemail=request.getParameter("uemail");
32: UsersDao ud=new UsersDao();
33: boolean b=ud.addUser(uname,upass,uage,uemail);

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.NumberFormatException: For input string: "uagestr"
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
java.lang.Integer.parseInt(Integer.java:447)
java.lang.Integer.parseInt(Integer.java:497)
org.apache.jsp.adoadd_jsp._jspService(adoadd_jsp.java:88)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.
谢谢5555555555
展开
 我来答
守护翼小宝
2011-05-21 · TA获得超过122个赞
知道小有建树答主
回答量:294
采纳率:0%
帮助的人:167万
展开全部
int uage=Integer.parseInt("uagestr"); string 类型的值 无法转换啊~
int uage=Integer.parseInt(uagestr); 这样写试试
如果这样的话 是调用uagestr 这个的值
yanchao90
2011-05-21 · TA获得超过848个赞
知道小有建树答主
回答量:492
采纳率:0%
帮助的人:531万
展开全部
27: <%String uname=request.getParameter("uname");
28: String upass=request.getParameter("upass");
29: String uagestr=request.getParameter("uage");
30: int uage=Integer.parseInt("uagestr");
31: String uemail=request.getParameter("uemail");
32: UsersDao ud=new UsersDao();
33: boolean b=ud.addUser(uname,upass,uage,uemail);

第30行改为int uage=Integer.parseInt(uagestr);
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式