发布网友
共1个回答
热心网友
java.lang.NumberFormatException: null
说明是你Integer.parseInt(times)报错的而不是this.getServletContext().getAttribute("visitTimes").toString()报错
这句话中this.getServletContext().getAttribute("visitTimes").toString() 没有报错
如果this.getServletContext().getAttribute("visitTimes") 是null的话
toString();会报nullpoint 会不会是你的this.getServletContext().getAttribute("visitTimes")
返回的是一个"null" 才导致转换异常的