java.lang.NumberFormatException: For input string: ""
org.apache.jasper.JasperException:ExceptioninJSP:/dd_del_save.jsp:4037:outbeizhu=requ...
org.apache.jasper.JasperException: Exception in JSP: /dd_del_save.jsp:40
37: outbeizhu=request.getParameter("outbeizhu");
38: if(request.getParameter("id")!=null)
39: num=request.getParameter("id");
40: int a=Integer.parseInt(shuliang.trim());
41: int b=Integer.parseInt(outshuliang.trim());
42: if(a>b)
43: {
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
java.lang.NumberFormatException: For input string: ""
java.lang.NumberFormatException.forInputString(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
org.apache.jsp.dd_005fdel_005fsave_jsp._jspService(dd_005fdel_005fsave_jsp.java:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 展开
37: outbeizhu=request.getParameter("outbeizhu");
38: if(request.getParameter("id")!=null)
39: num=request.getParameter("id");
40: int a=Integer.parseInt(shuliang.trim());
41: int b=Integer.parseInt(outshuliang.trim());
42: if(a>b)
43: {
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
java.lang.NumberFormatException: For input string: ""
java.lang.NumberFormatException.forInputString(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
org.apache.jsp.dd_005fdel_005fsave_jsp._jspService(dd_005fdel_005fsave_jsp.java:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729) 展开
展开全部
这个错误是由于Integer.parseInt 接受到了空字符串的原因,错误提示很明确java.lang.NumberFormatException: For input string: "";
确保要转型的字符串里只包含数字类型的字符就可解决。
确保要转型的字符串里只包含数字类型的字符就可解决。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
int a=Integer.parseInt(shuliang.trim());
试着用System.out.println(shuliang);打印一下数量,看看是否正确的传入参数。
试着用System.out.println(shuliang);打印一下数量,看看是否正确的传入参数。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
int a=Integer.parseInt(shuliang.trim())
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询