之前在项目中通过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. 分别利用并查集,DFS和BFS方法求联通块的数量

    联通块是指给定n个点,输入a,b(1<=a,b<=n),然后将a,b连接,凡是连接在一起的所有数就是一个联通块: 题意:第一行输入n,m,分别表示有n个数,有输入m对连接点,以下将要输入m ...

  2. 人工智能----TensorFlow开篇简介

    Artificial Intelligence,也就是人工智能.TensorFlow是Google在2015年底开源的项目 TensorFlow的论文地址:http://download.tensor ...

  3. JS学习之函数的属性和方法

  4. 任务调度 Quartz 学习(二) CronTrigger

    在Quartz中Trigger有 SimpleTrigger与CronTrigger两种: SimpleTrigger:当需要的是一次性的调度(仅是安排单独的任务在指定的时间及时执行),或者你需要在指 ...

  5. Packet Tracer 5.0 构建CCNA实验(2)—— 配置VLAN

    Packet Tracer 5.0 构建CCNA实验(2)—— 配置VLAN Vlan(Virtual Local Area Network) 即虚拟局域网.VLAN可以把同一个物理网络划分为多个逻辑 ...

  6. 【C++对象模型】第四章 Function 语意学

    1.Member的各种调用方式 1.1 Nonstatic Member Functions 实际上编译器是将member function被内化为nonmember的形式,经过下面转化步骤: 1.给 ...

  7. 「6月雅礼集训 2017 Day5」学外语

    [题目大意] 给出$\{P_i\}$,求经过以下操作后能够得到的不同序列个数: 第一步,选择$i, j$,交换$P_i,P_j$:第二步,把所有$P_x=i$的$P_x$变为$j$,把所有$P_x=j ...

  8. Exponial (欧拉定理+指数循环定理+欧拉函数+快速幂)

    题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=2021 Description Everybody loves big numbers ...

  9. Vue 定义组件模板的七种方式(一般用单文件组件更好)

    在 Vue 中定义一个组件模板,至少有七种不同的方式(或许还有其它我不知道的方式): 字符串 模板字面量 x-template 内联模板 render 函数 JSF 单文件组件 在这篇文章中,我将通过 ...

  10. Angular2.0 基础: 环境搭建

    最近在学习Angular2的使用,其实看过Angular2 文档的都知道,相比于之前的Angular1,Angular2 的改动还是挺大的. 而对于‘angular2 的本地开发环境的搭建的中,我们首 ...