at org.apache.el.parser.ELParser.generateParseException(ELParser.java:2195) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.jj_consume_token(ELParser.java:2077) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Unary(ELParser.java:951) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Multiplication(ELParser.java:711) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Math(ELParser.java:631) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Compare(ELParser.java:443) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Equality(ELParser.java:337) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.And(ELParser.java:281) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Or(ELParser.java:225) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Choice(ELParser.java:182) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Expression(ELParser.java:174) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Parameters(ELParser.java:1137) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.DotSuffix(ELParser.java:1060) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.ValueSuffix(ELParser.java:1032) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Value(ELParser.java:977) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Unary(ELParser.java:947) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Multiplication(ELParser.java:711) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Math(ELParser.java:631) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Compare(ELParser.java:443) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Equality(ELParser.java:337) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.And(ELParser.java:281) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Or(ELParser.java:225) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Choice(ELParser.java:182) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.Expression(ELParser.java:174) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.DeferredExpression(ELParser.java:112) [:6.0.0.20100721-M4] at org.apache.el.parser.ELParser.CompositeExpression(ELParser.java:40) [:6.0.0.20100721-M4] at org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:93) [:6.0.0.20100721-M4] at org.apache.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:150) [:6.0.0.20100721-M4] at org.apache.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:194) [:6.0.0.20100721-M4] at org.apache.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:68) [:6.0.0.20100721-M4] at com.sun.faces.facelets.tag.TagAttributeImpl.getValueExpression(TagAttributeImpl.java:378) [:2.0.2-FCS] at com.sun.faces.facelets.tag.TagAttributeImpl.getValueExpression(TagAttributeImpl.java:344) [:2.0.2-FCS] at com.sun.faces.facelets.tag.jsf.ValueHolderRule$DynamicValueExpressionMetadata.applyMetadata(ValueHolderRule.java:122) [:2.0.2-FCS] at com.sun.faces.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:74) [:2.0.2-FCS] at javax.faces.view.facelets.MetaTagHandler.setAttributes(MetaTagHandler.java:122) [:2.0.2-FCS] at javax.faces.view.facelets.DelegatingMetaTagHandler.setAttributes(DelegatingMetaTagHandler.java:96) [:2.0.2-FCS] at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:153) [:2.0.2-FCS] at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:114) [:2.0.2-FCS] at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:91) [:2.0.2-FCS] at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:120) [:2.0.2-FCS] at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:204) [:2.0.2-FCS] at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:114) [:2.0.2-FCS] at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:120) [:2.0.2-FCS] at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:204) [:2.0.2-FCS] at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:114) [:2.0.2-FCS] at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:91) [:2.0.2-FCS] at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:86) [:2.0.2-FCS] at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:91) [:2.0.2-FCS] at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:75) [:2.0.2-FCS] at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:145) [:2.0.2-FCS] at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:716) [:2.0.2-FCS] at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106) [:2.0.2-FCS] at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [:2.0.2-FCS] at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [:2.0.2-FCS] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313) [:2.0.2-FCS] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.20100721-M4] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100721-M4] at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:63) [:6.0.0.20100721-M4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.20100721-M4] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.20100721-M4] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.20100721-M4] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.20100721-M4] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.20100721-M4] at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.CR3] at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.CR3] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.20100721-M4] at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:93) [:6.0.0.20100721-M4] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.20100721-M4] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.20100721-M4] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.20100721-M4] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.20100721-M4] at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.20100721-M4] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.20100721-M4] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.20100721-M4] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [:6.0.0.20100721-M4] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.20100721-M4] at java.lang.Thread.run(Thread.java:619) [:1.6.0_20]

toString() method is used to be sure that method exists, but I observed the same behaviour for business methods.

The exception stack trace is different:

javax.el.ELException: /employee/view.xhtml: The class 'package.EmployeeViewController' does not have the property 'toString'. at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85) at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:78) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:298) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:101) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:849) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1643) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:389) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)

What is weird that EL (or Facelets) is looking for property not method. It looks that parentheses are ignored.

With JSF 2.0, there is now a set of rules that are followed to determine when the Facelets included with Mojarra 2.0.3 will be disabled. See the following list:
if /WEB-INF/faces-config.xml is versioned at 1.2 or older, JSF 2.0 Facelets will not be used. Make sure the version and web-facesconfig.xml schema reference are versioned at 2.0
If any of the faces-config.xml files reference the com.sun.facelets.FaceletViewHandler, JSF 2.0 Facelets will not be used. This allows for easy migration compatibility for those applications that have direct dependencies on Facelet classes.

My application deployed on the Glassfish 3.0.1 (upgraded to Mojarra 2.0.3) doesn't throw an exception. The faces-config is defined within 2.0 namespace, and the only JSF related libarary in the WAR file is a primefaces.

I will try to reproduce the issue with single-page example generated by Netbeans without any dependencies.

The enclosed stack trace was copied from facelet page, in the app server log file I found that at the end of each line [:2.0.3-SNAPSHOT] suffix exists:

at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85) [:2.0.3-SNAPSHOT]

javax.el.ELException: /jsf.xhtml: The class 'test.ElManagedBean' does not have the property 'hello'. at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85) at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:78) at com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:179) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:389) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:309) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) at java.lang.Thread.run(Thread.java:619)

You have put the expression in the middle of the Facelets page and not as the value of an attribute. As far as I know, this will always be treated as a ValueExpression. I don't see how this would work in Glassfish. It's possible that there is some code that tries it out as a ValueExpression and then tries it as a MethodExpression if it fails. However, I think that would go against the EL spec. In other words, I'm surprised that this would work on Glassfish.

I appreciate your explanation but I don't agree with you. If I want to access property I will use the following statement:

elManagedBean.hello

With brackets I expect method invocation instead of property access.

I'm not an expert in programming language design but EL expression evaluation should be independent of place where the expression is used. Different interpretation in "action" attribute and in the middle of facelet is weird. The inline expression elManagedBean.hello() should be equivalent to the <h:outputText value="elManagedBean.hello()"/>. I suppose that <h:outputText .../> also throws an exception (I don't have JBoss runtime to check, now).

If the EL is interpretted as you described it suks, IMHO. I'm wondering how it is defined in the spec, I will check :-)

I think you might be looking at EL 2.1 instead of EL 2.2. Params are now allowed to designate arguments passed to methods. In both specs, the use of [] braces is equivalent to using a dot '.'

Yes, it's all very weird and confusing. There are historical reasons why things are the way that are though. The issue remains that EL doesn't actually define whether something is treated as a ValueExpression or a MethodExpression. This decision is made by the technology that is using the EL: namely JSP, JSP taglibs in JSF 1.x, or Facelets in JSF 2.x.