javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-1920

Composite components with required attribute always fails to execute

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Linux/64bit
      Glassfish 3.1-b32

    • Status Whiteboard:
      Hide

      size_medium importance_large

      Show
      size_medium importance_large
    • Tags:

      Description

      Scenario: A composite component is declared under "resources/util" folder. When the component is declared with a required attribute the following error happens.

      Error message: "<util:productProfile> The following attribute(s) are required, but no values have been supplied for them: data."

      Workaround: Remove the "required " attribute from composite component interface.

      Examples:

      <!-- causes the error -->
      <composite:interface>
      <composite:attribute name="data" required="true" />
      </composite:interface>

      ----------------------

      <!-- workaround -->
      <composite:interface>
      <composite:attribute name="data" />
      </composite:interface>

        Activity

        Hide
        kenpaulsen added a comment -

        Thanks for filing this issue. However, I believe you intended to file this against JSF. The functionality you described is part of the JSF itself, not JSFTemplating.

        Thanks!

        Ken Paulsen

        Show
        kenpaulsen added a comment - Thanks for filing this issue. However, I believe you intended to file this against JSF. The functionality you described is part of the JSF itself, not JSFTemplating. Thanks! Ken Paulsen
        Hide
        William Markito added a comment -

        That's correct! I thought JSFTemplating would be related to JSF Composite components.

        Thanks for moving to the right bucket.

        Show
        William Markito added a comment - That's correct! I thought JSFTemplating would be related to JSF Composite components. Thanks for moving to the right bucket.
        Hide
        ioss added a comment - - edited

        see also http://java.net/jira/browse/JAVASERVERFACES-1916

        As of the title it is not a strict duplicate, but I added the probable cause, to that issue.

        Show
        ioss added a comment - - edited see also http://java.net/jira/browse/JAVASERVERFACES-1916 As of the title it is not a strict duplicate, but I added the probable cause, to that issue.
        Hide
        ioss added a comment -

        Attached Fix in #1916

        Show
        ioss added a comment - Attached Fix in #1916
        Hide
        ioss added a comment -

        I commited a fix for #1916 that should fix this issue too.
        The "Scenario" is a bit vague:

        • Was the attribute set in the using page? => It is expected to get that error message then.
        • Did the attribute evaluate to 'null' => This is fixed by the patch for #1916

        If there are other cases where this error message occurs, this issue may have to be reopened, for now I think it could be closed as fixed.

        Show
        ioss added a comment - I commited a fix for #1916 that should fix this issue too. The "Scenario" is a bit vague: Was the attribute set in the using page? => It is expected to get that error message then. Did the attribute evaluate to 'null' => This is fixed by the patch for #1916 If there are other cases where this error message occurs, this issue may have to be reopened, for now I think it could be closed as fixed.
        Hide
        William Markito added a comment -

        The issue is/was that I was setting the attribute in the "using page" and always getting the issue. The only fix was to remove the required attribute. It looks like it's related to the evaluate to null issue.

        Anyway, I just tested in the glassfish3.1-b39 and the issue is still happening.

        Here goes the details:

        javax.faces.view.facelets.TagException: /product/List.xhtml @30,67 <util:productProfile> The following attribute(s) are required, but no values have been supplied for them: data.
        at com.sun.faces.facelets.tag.composite.InterfaceHandler.validateComponent(InterfaceHandler.java:233)
        at com.sun.faces.facelets.tag.composite.InterfaceHandler.apply(InterfaceHandler.java:125)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
        at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
        at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.applyCompositeComponent(CompositeComponentTagHandler.java:349)
        at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.applyNextHandler(CompositeComponentTagHandler.java:190)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
        at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:103)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)
        at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366)
        at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:108)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
        at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188)
        at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
        at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
        at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
        at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
        at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)
        at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
        at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
        at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
        at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:769)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:396)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:817)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:718)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1007)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
        at java.lang.Thread.run(Thread.java:662)

        <b>Composite interface declaration:</b>

        <composite:interface>
        <composite:attribute name="data" required="true"/>
        </composite:interface>

        <b>Using page:</b>

        <h:column>
        <util:productProfile data="#

        {item}

        " />
        </h:column>

        It works if I just remove the required attribute.

        Show
        William Markito added a comment - The issue is/was that I was setting the attribute in the "using page" and always getting the issue. The only fix was to remove the required attribute. It looks like it's related to the evaluate to null issue. Anyway, I just tested in the glassfish3.1-b39 and the issue is still happening. Here goes the details: javax.faces.view.facelets.TagException: /product/List.xhtml @30,67 <util:productProfile> The following attribute(s) are required, but no values have been supplied for them: data. at com.sun.faces.facelets.tag.composite.InterfaceHandler.validateComponent(InterfaceHandler.java:233) at com.sun.faces.facelets.tag.composite.InterfaceHandler.apply(InterfaceHandler.java:125) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86) at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152) at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.applyCompositeComponent(CompositeComponentTagHandler.java:349) at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.applyNextHandler(CompositeComponentTagHandler.java:190) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188) at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188) at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188) at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188) at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188) at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:103) at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178) at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395) at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366) at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:108) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:188) at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98) at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86) at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308) at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367) at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346) at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199) at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155) at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93) at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86) at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152) at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:769) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:396) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:817) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:718) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1007) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:662) <b>Composite interface declaration:</b> <composite:interface> <composite:attribute name="data" required="true"/> </composite:interface> <b>Using page:</b> <h:column> <util:productProfile data="# {item} " /> </h:column> It works if I just remove the required attribute.
        Hide
        ioss added a comment -

        Hi William,

        sorry for the late reply, I missed your comment.
        I just checked with EdBurns, glassfish3.1-b39 does not contain that fix.
        The best way to make sure you have the fix, is to replace the faces jars in the glassfish faces module with a nightly build.

        Imre

        Show
        ioss added a comment - Hi William, sorry for the late reply, I missed your comment. I just checked with EdBurns, glassfish3.1-b39 does not contain that fix. The best way to make sure you have the fix, is to replace the faces jars in the glassfish faces module with a nightly build. Imre
        Hide
        Ed Burns added a comment -

        Reassign to Imre. Imre please close when you can confirm it is fixed.

        Show
        Ed Burns added a comment - Reassign to Imre. Imre please close when you can confirm it is fixed.
        Hide
        ioss added a comment -

        The provided information was included in a testcase and the current test runs do pass, so I am closing this issue.
        In case there are still issues, please reopen and if possible provide a testbundle.

        Show
        ioss added a comment - The provided information was included in a testcase and the current test runs do pass, so I am closing this issue. In case there are still issues, please reopen and if possible provide a testbundle.

          People

          • Assignee:
            ioss
            Reporter:
            William Markito
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: