之前在项目中通过EL表达式从cart 中取出itemPirce这个值时始终报:For input string: "${cart.itemPrice / 100}" 错误。

事故原因:

  在通过视图解析器并把数据填充到ModelAndView对象中时出现无法取出itemPrice这个值(EL表达式无效)。itemPrice没有值则再通过 /100运算就会报错。

  还有一种现象是在表单中出现空值并提交到后台进行处理,而提交到后台的是 " " 而不是null,则会出现此错误。

For input string: "..."的更多相关文章

  1. java.lang.NumberFormatException: For input string: "1608020001 " 错误

    错误: java.lang.NumberFormatException: For input string: "1608020001 "    at java.lang.Numbe ...

  2. java.lang.NumberFormatException: For input string: "Y"

    nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database.  ...

  3. mybatis 报错:Caused by: java.lang.NumberFormatException: For input string

    mybatis的if标签之前总是使用是否为空,今天要用到字符串比较的时候遇到了困难,倒腾半天,才在一个论坛上找到解决方法.笔记一下,如下: 转自:https://code.google.com/p/m ...

  4. java.lang.NumberFormatException: For input string:"filesId"

    做项目时候,页面获取出现了这个问题.找了好久一直以为是我字段或者是数据库字段问题导致引起的. 最后才发现是 struts2中jsp我写错了一个参数,一直导致报错.后来改了就好了. 当大家遇到这个问题的 ...

  5. 该死的类型转换For input string: "[Ljava.lang.String;@1352dda"

    今天又遇见了这个该死的问题,还是记下来备忘. 从map里取值的时候,将OBJECT对象 先转换成String 然后转换成integer报错 java.lang.NumberFormatExceptio ...

  6. 解决java.lang.NumberFormatException: For input string: "id"

    今天,项目突然报"java.lang.NumberFormatException:For input string:"id"",项目框架是spring,spri ...

  7. MyBatis报错:Caused by: java.lang.NumberFormatException: For input string: "XX"

    <select id="sltTreatment" resultType="com.vitaminmd.sunny.core.bo.Treatment"& ...

  8. Spring Scheduled定时任务报错 java.lang.IllegalStateException: Encountered invalid @Scheduled method 'xxx': For input string: "2S"

    报错信息如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ding ...

  9. Caused by: java.lang.NumberFormatException: For input string: "18446744073709551615"

    问题:Caused by: java.lang.NumberFormatException: For input string: "18446744073709551615" 原因 ...

  10. Redis集群环境使用的是redis4.0.x的版本,在用java客户端jedisCluster启动集群做数据处理时报java.lang.NumberFormatException: For input string: "7003@17003"问题解决

    java.lang.NumberFormatException: For input string: "7003@17003" at java.lang.NumberFormatE ...

随机推荐

  1. python升级引发的问题总结

    http://www.cnblogs.com/ajianbeyourself/p/4214398.html http://www.cnblogs.com/hanggegege/p/6993003.ht ...

  2. Maven命令行窗口指定settings.xml

    maven命令行窗口指定特定settings.xml 在命令行界面指定settings.xml,命令如下: mvn install --settings c:\user\settings.xml 例如 ...

  3. 51Nod 1095 Anigram单词 | Hash

    Input示例 5 add dad bad cad did 3 add cac dda Output示例 1 0 2 题意:一系列字符串,查询字符串S,能通过其他字符串交换串内字符顺序得到的字符串个数 ...

  4. 51Nod 1094 和为k的连续区间 | 水

    Input示例 6 10 1 2 3 4 5 6 Output示例 1 4 #include "cstdio" #include "algorithm" #in ...

  5. [洛谷P2610] [ZJOI2012]旅游

    洛谷题目链接:[ZJOI2012]旅游 题目描述 到了难得的暑假,为了庆祝小白在数学考试中取得的优异成绩,小蓝决定带小白出去旅游~~ 经过一番抉择,两人决定将T国作为他们的目的地.T国的国土可以用一个 ...

  6. Ant复制文件

    <?xml version="1.0" encoding="UTF-8"?> <project name ="test" ...

  7. 【BZOJ】1724 [Usaco2006 Nov]Fence Repair 切割木板

    [算法]贪心+堆 #include<cstdio> #include<algorithm> using namespace std; ; int n,heap[maxn],sz ...

  8. bzoj 2669 状压DP

    因为最多有8个'X',所以我们可以用w[i][s]来表示现在我们填了前i个数,填的X的为S,因为每次新加进来的数都不影响前面的最小值,所以我们可以随便添加,这样就有了剩下所有位置的方案,每次都这样转移 ...

  9. Android中TextView设置字体

    最近项目中出现把字体设置成宋体,微软雅黑,黑体,楷体等的需求; 度娘发现Android系统默认支持三种字体,分别为:“sans”, “serif”, “monospace",除此之外还可以使 ...

  10. Java8的Lambda表达式简介

    先阐述一下JSR(Java Specification Requests)规范,即Java语言的规范提案.是向JCP(Java Community Process)提出新增一个标准化技术规范的正式请求 ...