问答详情
源自:4-5 实现信息批量删除

无法批量删除,求详细解决办法。

HTTP Status 500 - For input string: "on"

type Exception report

message For input string: "on"

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.NumberFormatException: For input string: "on"
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
java.lang.Integer.parseInt(Integer.java:580)
java.lang.Integer.valueOf(Integer.java:766)
com.kelvin.service.MaintainService.deleteBatch(MaintainService.java:29)
com.kelvin.servlet.DeleteBatchServlet.doGet(DeleteBatchServlet.java:24)
com.kelvin.servlet.DeleteBatchServlet.doPost(DeleteBatchServlet.java:32)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
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/8.5.11 logs.

Apache Tomcat/8.5.11

控制台没报错。

提问者:KelvinMario 2017-04-23 23:25

个回答

  • 慕粉4059636
    2017-09-10 18:39:18

    在<input type="checkbox" name="id" />中加入value="${message.id }",当你不加value时,当checkbox选中时返回的是on

  • 慕粉1630491423
    2017-04-24 12:55:10

    看报错是int String转换时出现的异常,是不是字符串有"on"时你想转换成int