Can*_*ice 18 eclipse validation facelets el jsf-2
Eclipse Facelet HTML Validator针对以下行报告错误"无法将表达式运算符应用于方法绑定":
<ui:fragment rendered="#{!empty managedBean.getSomething('ENUM_VALUE', someInt)}">
Run Code Online (Sandbox Code Playgroud)
我在Juno帮助中找到了这个(我正在使用Kepler):
Applying operator to method binding
#{bean.action * 5}
If bean.action indicates a method "action()" on bean, then it is not legal EL to treat its result as a value. In the example, multiplying action by 5 attempts treat it is as a value.
Run Code Online (Sandbox Code Playgroud)
我无法理解为什么将结果视为价值是不合法的?那么编写EL的正确方法是什么?谢谢!
pas*_*sql 19
如果您愿意,可以通过设置隐藏错误消息
Window- > Preferences- > Web- > JavaServer Faces Tool- >Validation -> General Problems
值Applying method operator to binding到Ignore.
Ras*_*ash 14
你有没有试过在你的方法周围使用paranthesis.像这样:
#{!empty (managedBean.getSomething('ENUM_VALUE', someInt))}
Run Code Online (Sandbox Code Playgroud)
这样JSF评估方法然后检查null或empty.
我不是JSF的专家,但我在其中一个类似的表达式中遇到了同样的问题:
#{some_method() == 0 and some_other_method() eq 'some value'}
Run Code Online (Sandbox Code Playgroud)
我看到了Eclipse显示的相同问题,但页面运行正常.在我的两个表达式周围放置了paranthesis后,Eclipse没有显示该错误.
| 归档时间: |
|
| 查看次数: |
12132 次 |
| 最近记录: |