jsp double 类型转换
7:Stringuser=request.getParameter("user");8:Stringtype=request.getParameter("type");9...
7: String user=request.getParameter("user");
8: String type=request.getParameter("type");
9: String street=request.getParameter("street");
10: double price1=Double.valueOf(request.getParameter("price1"));
11: double price2=Double.valueOf(request.getParameter("price2"));
12: double floorage1=Double.parseDouble(request.getParameter("floorage1"));
13: double floorage2=Double.parseDouble(request.getParameter("floorage2"));
Stacktrace:] with root cause
java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:994)
at java.lang.Double.valueOf(Double.java:475)
at org.apache.jsp.dohouse_jsp._jspService(dohouse_jsp.java:69)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
麻烦各位帮忙看一下为什么会报类型转换错误 展开
8: String type=request.getParameter("type");
9: String street=request.getParameter("street");
10: double price1=Double.valueOf(request.getParameter("price1"));
11: double price2=Double.valueOf(request.getParameter("price2"));
12: double floorage1=Double.parseDouble(request.getParameter("floorage1"));
13: double floorage2=Double.parseDouble(request.getParameter("floorage2"));
Stacktrace:] with root cause
java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:994)
at java.lang.Double.valueOf(Double.java:475)
at org.apache.jsp.dohouse_jsp._jspService(dohouse_jsp.java:69)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
麻烦各位帮忙看一下为什么会报类型转换错误 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询