开发者

Available operators in JSF 2.0 ValueExpression

开发者 https://www.devze.com 2023-02-04 13:50 出处:网络
I have been using expressions like this in JSF 1.2: rendered=\"#{foo.bar!=null && !foo.isBar}\". However in JSF 2.0 I\'ve found this doesn\'t work, and rendered=\"#{foo.b开发者_如何学Pythonar!

I have been using expressions like this in JSF 1.2: rendered="#{foo.bar!=null && !foo.isBar}". However in JSF 2.0 I've found this doesn't work, and rendered="#{foo.b开发者_如何学Pythonar!=null and !foo.isBar}" comes out to be the solution that doesn't throw any Exception.

Please tell me what operators can be used in these situations!

Thanks in advance, Daniel


&& needs escaping in XML, which is why and works and && doesn't. You would have to write &&. In any case neither is correct. If x has a boolean property bar, the way to test it in EL is via #{x.bar}, not #{x.isBar}.

The EL operators are defined in the documentation.

0

精彩评论

暂无评论...
验证码 换一张
取 消