I’ ve a JSF page that shows the content of a folder (really it’s a dropbox’s account content).
I’m using a dataTable to render the content of a ListArray object:
<h:dataTable style="text-align: left" width="600" var="dContent" value="#{backedBean.contents}">
<h:column>
<f:facet name="header">
<f:verbatim>NAME</f:verbatim>
</f:facet>
<h:commandButton value="#{dContent.fileName}" action="#{backedBean.updateContents(dContent)}"/>
</h:column>
<h:column>
<f:facet name="header">
<f:verbatim>SIZE</f:verbatim>
</f:facet>
<h:outputText value="#{dContent.size}"/>
</h:column>
</h:dataTable>
But when I run this page I obtain the following error:
/browse.xhtml @34,110 action=”#{backedBean.updateContents(dContent)}”
Error Parsing: #{backedBean.updateContents(dContent)}
…
…
Caused by: org.apache.el.parser.ParseException: Encountered ”
“(” “( “” at line 1, column 28. Was expecting one of:
“}” …
“.” …
“[” …
“>” …
“gt” …
“<” …
“lt” …
“>=” …
“ge” …
…
…
The funny thing is that Netbeans is able to autocomplete the method name so I image that my backend bean is ok. The problem occurs only when I call a method with a parameter.
Any ideas?
Many thanks
Passing method arguments was introduced in EL 2.2. So this is only possible if you’re running on a Servlet 3.0 / EL 2.2 capable container like Tomcat 7, Glassfish 3, JBoss AS 6, etc and your
web.xmlis been declared as per Servlet 3.0 specification.If you aren’t, then check this answer for alternatives with regard to obtaining current row in datatables, or this answer with regard to replacing the EL implementation by one which supports passing method arguments so that you can use it on Servlet 2.5 / EL 2.1 containers as well.