500 (Internal Server Error)

后台错误详情:
严重: Servlet.service() for servlet [springMvc] in context with path [/Scada] threw exception [Request processing failed; nested exception is java.lang.NumberFormatException: For input string: “”] with root cause
java.lang.NumberFormatException: For input string: “”

前台错误详情:
POST http://localhost:8080/.../… 500 (Internal Server Error)

错误原因:
对空字符串进行数据转换了,如下

tbSource.setType(Integer.valueOf(map.get("dataSourcePath")));

如果map.get("dataSourcePath"))为空,就不能将其转化成Integer类型

解决方法:
对该值转换前进行判断

猜你喜欢

转载自blog.csdn.net/weixin_40626699/article/details/85156653