7 Replies Latest reply on Feb 5, 2007 3:31 AM by smokingapipe

    Problems with el

      The following code doesn't work:

      <h:outputText rendered="#{trialManager.elTest(elHelper.manager)}">GESCHAFFT..</h:outputText>


      16:45:13,131 ERROR [STDERR] Feb 2, 2007 4:45:13 PM com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/user/trial/trialHome.xhtml]
      com.sun.facelets.tag.TagAttributeException: /user/trial/trialHome.xhtml @29,69 rendered="#{trialManager.elTest(elHelper.manager)}" Error Parsing: #{trialManager.elTest(elHelper.manager)}
       at com.sun.facelets.tag.TagAttribute.getValueExpression(TagAttribute.java:259)
       at com.sun.facelets.tag.jsf.ComponentRule$ValueBindingMetadata.applyMetadata(ComponentRule.java:90)
       at com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36)
       at com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62)
       at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:140)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:295)
       at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:165)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.tag.ui.DefineHandler.apply(DefineHandler.java:58)
       at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:128)
       at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:306)
       at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:279)
       at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
       at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
       at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
       at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143)
       at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
       at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
       at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
       at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:510)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:46)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.el.ELException: Error Parsing: #{trialManager.elTest(elHelper.manager)}
       at com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:140)
       at com.sun.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:157)
       at com.sun.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:201)
       at com.sun.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:74)
       at org.jboss.seam.ui.facelet.SeamExpressionFactory.createValueExpression(SeamExpressionFactory.java:105)
       at com.sun.facelets.tag.TagAttribute.getValueExpression(TagAttribute.java:256)
       ... 54 more
      Caused by: com.sun.el.parser.ParseException: Encountered "(" at line 1, column 22.
      Was expecting one of:
       "}" ...
       "." ...
       "[" ...
       ">" ...
       "gt" ...
       "<" ...
       "lt" ...
       ">=" ...
       "ge" ...
       "<=" ...
       "le" ...
       "==" ...
       "eq" ...
       "!=" ...
       "ne" ...
       "&&" ...
       "and" ...
       "||" ...
       "or" ...
       "*" ...
       "+" ...
       "-" ...
       "?" ...
       "/" ...
       "div" ...
       "%" ...
       "mod" ...
      
       at com.sun.el.parser.ELParser.generateParseException(ELParser.java:1651)
       at com.sun.el.parser.ELParser.jj_consume_token(ELParser.java:1531)
       at com.sun.el.parser.ELParser.DeferredExpression(ELParser.java:134)
       at com.sun.el.parser.ELParser.CompositeExpression(ELParser.java:61)
       at com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:103)
       ... 59 more


      By the way: following code DOES work:

      <h:form id="elManager">
      <h:commandButton action="#{trialManager.elTest(elHelper.manager)}"
       value="Los" /></h:form>


      I absolutely do not understand. Thank you for helping.

        • 1. Re: Problems with el
          gavin.king

          You need SeamFaceletViewHandler. Check the docs.

          • 2. Re: Problems with el

            hehe :) , facelets/jsf is sometimes just funny ... sorry can't really help you, a dirty work around could be:

            <c:if test="#{trialManager.elTest(elHelper.manager)}">
            MADE IT!
            </c:if>
            


            don't even know if that would work for sure :\

            • 3. Re: Problems with el

              damn...gavin was faster, and probably right...

              • 4. Re: Problems with el

                I DO use SeamFaceletViewHandler.


                Why does the functionality works by using commandButton action but not with a simple "h:outputText rendered..."?

                Isn't it possible to return boolean value?



                • 5. Re: Problems with el
                  pmuir

                  AFAIK the EL enhancement is only supported on action methods not on value bindings. This is in the docs (but perhaps not very clearly, as it assumes you know the difference between a method expression and a value expression)

                  • 6. Re: Problems with el

                    You're obviously right. It does only work with action methods. But what's the reason for that?
                    Now I have a big problem:
                    How can I switch on/off Menus (including items) depending from userRole (by NOT using Strings)? I have lots of permissions, while each permission is equivilant to one menuItem. How can I deal with that by staying flexibly?

                    Thanks
                    Michael

                    • 7. Re: Problems with el
                      smokingapipe

                      How could it work on value bindings? Think about it. It's always possible for a value binding to be bi-directional. It must be get-able and set-able. If it's a method call with a parameter, how could that be setable? This is logical and I don't see any logical way it could be otherwise.

                      As for user roles, I'm about to have the same problem and I'm hoping that the new Seam security stuff will be not too traumatic to get integrated.