【问题标题】:Accessing bean object methods from xhtml in RichFaces在 RichFaces 中从 xhtml 访问 bean 对象方法
【发布时间】:2011-02-08 08:15:13
【问题描述】:

当我在我的 xhtml 中使用 (1) 时,我得到一个与 (2) 一样的错误。如何访问我的 bean 中数组的大小?

(1) 自定义类类型的对象列表,通过rich:column 中的rich:subTable 中的rich:dataTable 中的h:outputText 访问:

<h:outputText value="Info:  #{f.filemask.size()}" />

(2)

Caused by: com.sun.facelets.tag.TagAttributeException: /nodeConfig.xhtml @190,91 value="Info:  #{f.filemask.size()" Error Parsing: Info:  #{f.filemask.size()}
    at com.sun.facelets.tag.TagAttribute.getValueExpression(TagAttribute.java:259)
...
Caused by: org.apache.el.parser.ParseException: Encountered " "(" "( "" at line 1, column 41.
Was expecting one of:
    "}" ...
    "." ...
    "[" ...
    ">" ...
    "gt" ...
    "<" ...
    "lt" ...
    ">=" ...
    "ge" ...
    "<=" ...
    "le" ...
    "==" ...
    "eq" ...
    "!=" ...
    "ne" ...
    "&&" ...
    "and" ...
    "||" ...
    "or" ...
    "*" ...
    "+" ...
    "-" ...
    "/" ...
    "div" ...
    "%" ...
    "mod" ...

非常感谢任何帮助。我似乎找不到使用此类方法的参考,但 this reference 报告它工作正常

【问题讨论】:

    标签: java richfaces el


    【解决方案1】:

    “普通”EL 不支持此功能。可能性:

    1. 写一个getter getFileMaskSize())并访问#{f.fileMaskSize}
    2. 使用JBoss EL

    【讨论】:

    • 我以为你会这么说。谢谢。
    猜你喜欢
    • 2011-02-08
    • 2014-06-25
    • 2017-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-07-30
    • 2011-01-01
    相关资源
    最近更新 更多