type Exception report
message
description The server encountered an internal error () that
prevented it from fulfilling this request.
exception
java.lang.NumberFormatException: For input string: "null"
java.lang.NumberFormatException.forInputString(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
com.realstyle.servlet.EmergencyMessageServlet.doPost(EmergencyMessageServlet.java:142)
com.realstyle.servlet.EmergencyMessageServlet.doGet(EmergencyMessageServlet.java:931)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the
Apache Tomcat/7.0.22 logs.
这个是在操作中出现的 想知道这是程序问题 还是操作不当引起的
追答这个是你程序有问题啥,你没有考虑异常输入!
使用parseInt就是可能抛出NumberFormatException异常,
你程序要捕获和处理这种异常,然后返回错误提示给客户啊,二不是目前这样,
直接暴露500错误给客户!