0

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

(1) 一个自定义类类型的对象列表,通过 a in a in a 中的h:outputText以下rich:column内容rich:subTable访问rich:dataTable

<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" ...

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

4

1 回答 1

1

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

  1. 写一个 getter getFileMaskSize()) 并访问#{f.fileMaskSize}.
  2. 使用JBoss EL
于 2010-04-15T11:35:38.510 回答