测试-HTTP Status 500 - For input string: "3.0"

问题描述

HTTP Status 500 - For input string: "3.0"

我在做一个增加数据功能的网页,测试时出现了错误提示如下(输入整型数据时不报错,但是输入浮点型数据时却报错):
java.lang.NumberFormatException: For input string: "2.0"
java.lang.NumberFormatException.forInputString(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
example4.Insert.doPost(Insert.java:31)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.68 logs.
相关代码如下:
view界面代码:


X:
Y:

javabean代码:
//获取前台页面数据
String x3 =request.getParameter("x");

    double x = Double.parseDouble(x3); 

    String y1 =request.getParameter("y");

    double y = Double.parseDouble(y1); 

    我是新手,请各位大神帮我诊断一下,感激不尽!

解决方案

type?Exception report
message?For input string: " 1"
description?The server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.NumberFormatException:......
答案就在这里:HTTP Status 500 - For input string: " 1"

解决方案二:

http://bbs.csdn.net/topics/390946182

时间: 2024-09-29 17:15:49

测试-HTTP Status 500 - For input string: "3.0"的相关文章

HTTP Status 500 - For input string: "3.125" 求帮助,摆脱!

问题描述 各位大神,求帮忙,我在这个div标签里面,为什么增加一个input标签,类型是checkbox的,然后就会出现这样的错误!! 解决方案 解决方案二:具体怎么出错.是不是数字和string之间转换错?解决方案三:引用1楼rui888的回复: 具体怎么出错.是不是数字和string之间转换错? 就是如果我不增加一个checkbox类型的input就不会报这样的错误,但只要我一加,就会报这样的错误了解决方案四:你100你个不报错吗?解决方案五:引用1楼rui888的回复: 具体怎么出错.是不

HTTP Status 500 - /index.jsp (line: 2, column: 40) File "/struts-tags" not found

问题描述 我已经把struts2-core-2.3.4.1.jar加入了buildpath和web-info的lib目录下了,还是出这个错误,jstl.jar也加了,请各位高手明示原因jsp文件的头几行如下:<%@pagelanguage="java"pageEncoding="utf-8"%><%@tagliburi="/struts-tags"prefix="s"%><!DOCTYPEhtml

s2sh-报错:HTTP Status 500 -怎么解决

问题描述 报错:HTTP Status 500 -怎么解决 java.lang.NullPointerException com.hbue.edu.actions.LoginAction.execute(LoginAction.java:38) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp

php iconv() : Detected an illegal character in input string

开始是这样用的$str = iconv('UTF-8', 'GB2312', unescape(isset($_GET['str'])? $_GET['str']:''));上线后报一堆这样的错:iconv() : Detected an illegal character in input string 考虑到GB2312字符集比较小,换个大的吧,于是改成GBK:$str = iconv('UTF-8', 'GBK', unescape(isset($_GET['str'])? $_GET['

status-系统网页出现这报错:HTTP Status 500,是访问JSP页面哪个地方出错了或者别的?

问题描述 系统网页出现这报错:HTTP Status 500,是访问JSP页面哪个地方出错了或者别的? HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: j

javaweb-HTTP Status 500 - Unable to load class for JSP

问题描述 HTTP Status 500 - Unable to load class for JSP <%@ page contentType="text/html pageEncoding="GBK"%> <%@ page import="java.io.*"%> <%@ page import="java.util.*"%> <%@ page import="java.math.

jsp-HTTP Status 500 - Unable to compile class for JSP

问题描述 HTTP Status 500 - Unable to compile class for JSP 求大牛求解!新手不了解 j点击Jsp页面出现的错误 type Exception report message Unable to compile class for JSP description The server encountered an internal error that prevented it from fulfilling this request. except

各路大神求救!HTTP Status 500 - Malformed OGNL expression:

问题描述 各路大神求救!HTTP Status 500 - Malformed OGNL expression: JSP代码: <li><a href="Student_Query_Electric_bill?type=0&studentnum=<s:property value="#session.loginUserNum"/>" target="MainFrame">电费</a><

struts2-求大神解决。。HTTP Status 500 。

问题描述 求大神解决..HTTP Status 500 . HTTP Status 500 - com.cheng.action.impl.Cc1001Action.searchMenu.action() type Exception report message com.cheng.action.impl.Cc1001Action.searchMenu.action() description The server encountered an internal error that prev