EL char

描述:在jsp里用 ${order.isNeedInvoice=='N'? 'checked':''}  ,isNeedInvoice 在后台是character类型的。

问题:报错,javax.el.ELException: Cannot convert N of type class java.lang.String to class java.lang.Long

 

 

查了资料,发现说EL表达式没有CHAR类型,他会把CHAR转成LONG,

参考:https://bz.apache.org/bugzilla/show_bug.cgi?id=52666,tomcat BUG?

EL官方文档:

A {<,>,<=,>=,lt,gt,le,ge} B 

■ If A==B, if operator is <=, le, >=, or ge return true. 
■ If A is null or B is null, return false 
■ If A or B is BigDecimal, coerce both A and B to BigDecimal and use the return 
value of A.compareTo(B). 
■ If A or B is Float or Double coerce both A and B to Double apply operator 
■ If A or B is BigInteger, coerce both A and B to BigInteger and use the return 
value of A.compareTo(B). 
Chapter 1 Language Syntax and Semantics 13 
■ If A or B is Byte, Short, Character, Integer, or Long coerce both A and B to 
Long and apply operator
 
■ If A or B is String coerce both A and B to String, compare lexically 
■ If A is Comparable, then: 
■ If A.compareTo(B) throws exception, error. 
■ Otherwise use result of A.compareTo(B) 
■ If B is Comparable, then: 
■ If B.compareTo(A) throws exception, error. 
■ Otherwise use result of B.compareTo(A) 
■ Otherwise, error

 

CHAR类型,还是别出现的好,在后台转成String 吧

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值