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 展开
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 展开
2个回答
展开全部
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);
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);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询