Closed GoogleCodeExporter closed 9 years ago
例子2)里面的代码写错了,抱歉
正确的如下
System.out.println(2+-3);
ElValue val = El.eval("2+-3");
System.out.println(val.get());
PS:貌似没法直接在iss里面更改内容么?
Original comment by ywjno....@gmail.com
on 26 May 2011 at 8:29
[deleted comment]
继续在来一个会出错的例子
代码
System.out.println(-3*-3);
ElValue val = El.eval("-3*-3");
System.out.println(val.get());
控制台显示如下
9
log4j:WARN No appenders could be found for logger (org.nutz.resource.Scans).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.nutz.el.ElException: I don't know how to handle
char '-'
at org.nutz.el.impl.NutElSpliter.splite(NutElSpliter.java:62)
at org.nutz.el.El.compile(El.java:96)
at org.nutz.el.El.compile(El.java:85)
at org.nutz.el.El.eval(El.java:118)
at org.nutz.el.El.eval(El.java:130)
at testEL.main(testEL.java:17)
貌似el表达式里面有负号的话都不怎么好使
Original comment by ywjno....@gmail.com
on 3 Jun 2011 at 8:03
的确,不知道是不是不支持呢
Original comment by wendal1985@gmail.com
on 3 Jun 2011 at 12:58
貌似是NutElSpliter类的splite方法里面把“-”当成了运算符而没�
��到还有表示负数的意思
Original comment by ywjno....@gmail.com
on 8 Jun 2011 at 2:17
在新版EL中已经将这个问题解决了
Original comment by juq...@gmail.com
on 30 Jun 2011 at 6:14
Original issue reported on code.google.com by
ywjno....@gmail.com
on 26 May 2011 at 8:26