4 Replies Latest reply on Feb 27, 2009 9:29 AM by leo.mekenkamp

    Why is the action attribute a forced EL expression in menuIt

    leo.mekenkamp

      This is something that completely evades me. The standard JSF components let me do stuff like

      <h:commandButton value="bla" action="some.action.string"/>


      Why *must* the action attribute in the v3.3 rich:menuItem have an EL expression? Now I am forced to have unnecessary boiler plate code like

      public Object someAction() {
       return "some.action.string";
      }


      in some managed bean. This is very counterproductive and goes against what you can do with standard html components in de specs. Or am I missing something here?

        • 1. Re: Why is the action attribute a forced EL expression in me
          nbelaevski

          Hi,

          Works for me without problems under JSP and Facelets:

          <rich:dropDownMenu value="menu">
           <rich:menuItem action="test.toForumZ" value="Test" />
           </rich:dropDownMenu>
          

          RF 3.3.0

          • 2. Re: Why is the action attribute a forced EL expression in me
            leo.mekenkamp

            That's strange. On

            <rich:menuItem value="home" action="home" immediate="true"/>

            I get the following exception:
            SEVERE: ERROR: 'cvc-pattern-valid: Value 'home' is not facet-valid with respect to pattern '#\{.*}' for type 'faces-config-el-expressionType'.'
            SEVERE: WebModule[/wieNG]PWC1275: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
            com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! cvc-pattern-valid: Value 'home' is not facet-valid with respect to pattern '#\{.*}' for type 'faces-config-el-expressionType'.
             at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:213)
             at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:196)
             at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4623)
             at org.apache.catalina.core.StandardContext.start(StandardContext.java:5323)
             at com.sun.enterprise.web.WebModule.start(WebModule.java:456)
             at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:922)
             at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:906)
             at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:696)
             at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2205)
             at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1890)
             at com.sun.enterprise.web.WebApplication.start(WebApplication.java:85)
             at com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:560)
             at com.sun.enterprise.v3.server.ApplicationLifecycle.start(ApplicationLifecycle.java:547)
             at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:189)
             at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:260)
             at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:97)
             at com.sun.enterprise.v3.server.ApplicationLoaderInjector.postConstruct(ApplicationLoaderInjector.java:61)
             at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:150)
             at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:90)
             at java.security.AccessController.doPrivileged(Native Method)
             at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:87)
             at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:75)
             at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58)
             at com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107)
             at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60)
             at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:203)
             at com.sun.enterprise.v3.server.AppServerStartup$1.run(AppServerStartup.java:116)
            Caused by: org.xml.sax.SAXParseException: cvc-pattern-valid: Value 'home' is not facet-valid with respect to pattern '#\{.*}' for type 'faces-config-el-expressionType'.
             at com.sun.org.apache.xerces.internal.jaxp.validation.Util.toSAXParseException(Util.java:109)
             at com.sun.org.apache.xerces.internal.jaxp.validation.ErrorHandlerAdaptor.error(ErrorHandlerAdaptor.java:104)
             at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
             at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
             at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:429)
             at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3185)
             at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(XMLSchemaValidator.java:3152)
             at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3121)
             at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:3025)
             at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2178)
             at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:814)
             at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorHandlerImpl.endElement(ValidatorHandlerImpl.java:345)
             at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:262)
             at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:555)
             at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:220)
             at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:215)
             at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:215)
             at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:215)
             at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:121)
             at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:85)
             at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:615)
             at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:661)
             at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:300)
             at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.process(ValidatorImpl.java:220)
             at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:141)
             at javax.xml.validation.Validator.validate(Validator.java:82)
             at com.sun.faces.config.ConfigManager$ParseTask.getDocument(ConfigManager.java:434)
             at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:394)
             at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:351)
             at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
             at java.util.concurrent.FutureTask.run(FutureTask.java:123)
             at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
             at java.lang.Thread.run(Thread.java:613)

            Probably has something to do with Glassfish and Richfaces biting each other.

            • 3. Re: Why is the action attribute a forced EL expression in me
              nbelaevski

              Hello,

              That's an error parsing faces-config.xml. Please make sure it is correct.

              • 4. Re: Why is the action attribute a forced EL expression in me
                leo.mekenkamp

                You are right about the parsing; I seem to be having some strange issues with redeployments though. Reminder to self (again): before nagging others, always do a complete shutdown, rebuild and redeploy when encountering something strange.