开发者社区> 问答> 正文

jquery jsp 删除和修改。? 400 报错

jquery jsp 删除和修改。? 400 报错 <%@ page language="java" import="java.util." import="java.sql." pageEncoding="utf-8"%>
<jsp:useBean id="dbConn" class="pack_convert.DBConnXmgl"/>
<jsp:useBean id="projectinfo" class="net.gvsun.database.ProjectInfo"/>
<%@ page session="true" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <%
 String id = request.getParameter("id");
 int aid = Integer.parseInt(id);
 boolean bol = projectinfo.deleteCash(aid);
      if(bol){
           out.println("{"success":"true","msg":"添加成功!"}");
     }else{
           out.println("{"failure":"failure","msg":"出错了,请重新操作!"}");
     }
 response.setHeader("Refresh","1; URL=../../projectFinance.jsp");//1秒后自动跳转页面
 //out.println(bol);//打印结果
 dbConn.releaseConn();

 %>

这行报以下错误:java.lang.NumberFormatException: For input string: "undefined"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:449)
    at java.lang.Integer.parseInt(Integer.java:499)
    at org.apache.jsp.projectinfo.jsp.deleteCash_jsp._jspService(deleteCash_jsp.java:82)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)

这是为什么啊?

 


展开
收起
爱吃鱼的程序员 2020-06-04 16:18:01 447 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    你木有判断id是否传过来,并且传过来的是否是数字,你现在的应该是传过来了个JS的空值“ undefined ”,JAVA格式化出错######哦,懂了######同楼上,类型转换异常######哦,动了

    2020-06-04 17:47:26
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
23-Vue.js在前端...1506518547.pdf 立即下载
《零基础HTML入门教程》 立即下载
低代码开发师(初级)实战教程 立即下载