JSTL访问Map问题,key为Integer或Long
来源:互联网 发布:2018年5g网络 编辑:程序博客网 时间:2024/05/29 17:39
参考stackoverflows上的这篇文章 http://stackoverflow.com/questions/924451/jstl-access-a-map-value-by-key
无法取到值。
换成 即正常。
原因是JSTL默认把数字封装成Long类型。
另一个问题:类型转换
Map<Long, String> map = new HashMap<Long, String>();
${map[obj.id]}
obj.id定义为int类型时,无法取到值。需要将obj.id转为Long。
在jsp页面可以这样写
- JSTL访问Map问题,key为Integer或Long
- Map key为Integer类型时用Long值取value问题
- JSTL通过数值key访问map的陷阱
- integer转换为 long
- c++ map中key为类对象或结构体
- java Long转换为Integer
- java中Long和Integer在hashmap判断key是否存在的问题
- BeanUtils.copyProperties 如果Integer 或Long 为null 默认赋值0
- BeanUtils.copyProperties 如果Integer 或Long 为null 默认赋值0
- map的[]操作符访问不存在的Key的问题!
- EL表达式取出Map集合中key为Integer类型的值,bug解决方案
- EL表达式Map(key为Integer类型)取值bug解决方案
- java int 转化为Long integer转化为Long
- Java过滤掉map集合中key或value为空的值
- 通用工具类(过滤掉map集合中key或value为空的值)
- EL表达式与ognl表达式对Map的key为Integer时的取值,Ognl表达式比较友好
- java 中Map List 等集合只能存放Integer Long
- java long Integer cannot be cast to java.util.Map
- Firefox 脚本病毒 redirect-script
- javascript 函数
- firefox 3 call Components.classes 错误
- 转:如何调整ABAP程序的性能
- 程序员面试题精选 (转载)
- JSTL访问Map问题,key为Integer或Long
- Setting up an extension development environment
- 无题
- Android进行中
- document.ready和onload的区别
- Checkstyle+Eclipse
- 转: SAP用户出口的类型 User Exit
- cygwin
- 情绪管理的方法