ICEfaces
  1. ICEfaces
  2. ICE-3680

outputResource label attribute throws EL exception when value bound

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.2
    • Fix Version/s: 1.8RC1, 1.8
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      All
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hardcode label attribute.

      Description

      Note from customer:

      More issues with outputResource...
       
      This works...
       
           <ice:outputResource
             resource="#{hc1099rep2008Pdf.resourceMap[hc1099]}" mimeType="application/pdf"
             fileName="#{msg.searchResults_link_view}"
             value="view"
             type="button"
             attachment="false"/>
       
      Also This works..
       
            <ice:outputResource
             resource="#{hc1099rep2008Pdf.resourceMap[hc1099]}" mimeType="application/pdf"
             fileName="#{msg.searchResults_link_view}"
             label="view"
             value="view"
             attachment="false"/>

      This doesn't

            <ice:outputResource
             resource="#{hc1099rep2008Pdf.resourceMap[hc1099]}" mimeType="application/pdf"
             fileName="#{msg.searchResults_link_view}"
             label="#{msg.searchResults_link_view}"
             value="view"
             attachment="false"/>
       
      Note the value binding for label instead of it hard coded that appears to cause problem. hard coding works.....

      I get following error
       
      java.lang.NullPointerException
       at com.sun.facelets.el.ELAdaptor.getELContext(ELAdaptor.java:47)
       at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:54)
       at com.icesoft.faces.component.outputresource.OutputResource.getLabel(OutputResource.java:189)
       at com.icesoft.faces.component.outputresource.OutputResource$1.withOptions(OutputResource.java:89)
       at com.icesoft.faces.webapp.http.core.ResourceDispatcher$ResourceServer.respond(ResourceDispatcher.java:100)
       at com.icesoft.faces.webapp.http.common.standard.CompressingServer$CompressingRequest$1.respond(CompressingServer.java:65)
       at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:167)
       at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet$ThreadBlockingRequestResponse.respondWith(ThreadBlockingAdaptingServlet.java:36)
       at com.icesoft.faces.webapp.http.common.standard.CompressingServer$CompressingRequest.respondWith(CompressingServer.java:61)
       at com.icesoft.faces.webapp.http.core.ResourceDispatcher$ResourceServer.service(ResourceDispatcher.java:94)
       at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
       at com.icesoft.faces.webapp.http.common.standard.CompressingServer.service(CompressingServer.java:44)
       at com.icesoft.faces.webapp.http.core.ResourceDispatcher.service(ResourceDispatcher.java:41)
       at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
       at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
       

        Activity

        Tyler Johnson created issue -
        Tyler Johnson made changes -
        Field Original Value New Value
        Assignee Adnan Durrani [ adnan.durrani ]
        Ken Fyten made changes -
        Fix Version/s 1.8DR#3 [ 10143 ]
        Adnan Durrani made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Adnan Durrani added a comment -

        I have tested the following snippet, and it works fine. Can you please attach a test case which demonstrate the problem.

        <ice:dataTable border="1" var="item" value="#

        {myBean.dataList}

        ">
        <ice:column>
        <f:facet name="header">
        <ice:outputText value="Resource" />
        </f:facet>
        <ice:outputResource shared="false" fileName="#

        {item.fileName}"
        resource="#{item.fileResource}" label="#{item.fileName}

        " />
        </ice:column>
        </ice:dataTable>

        Show
        Adnan Durrani added a comment - I have tested the following snippet, and it works fine. Can you please attach a test case which demonstrate the problem. <ice:dataTable border="1" var="item" value="# {myBean.dataList} "> <ice:column> <f:facet name="header"> <ice:outputText value="Resource" /> </f:facet> <ice:outputResource shared="false" fileName="# {item.fileName}" resource="#{item.fileResource}" label="#{item.fileName} " /> </ice:column> </ice:dataTable>
        Hide
        Sam Xiao added a comment -

        Same exception is throws when using EL expression for mimeType attribute

        Show
        Sam Xiao added a comment - Same exception is throws when using EL expression for mimeType attribute
        Hide
        Sam Xiao added a comment -

        test app. for "mimeType" should be easily changed to test other attributes

        Show
        Sam Xiao added a comment - test app. for "mimeType" should be easily changed to test other attributes
        Sam Xiao made changes -
        Attachment support5311.war [ 11338 ]
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Priority P1
        Ken Fyten made changes -
        Salesforce Case []
        Assignee Adnan Durrani [ adnan.durrani ] Yip Ng [ yip.ng ]
        Hide
        yip.ng added a comment -

        The value binding works when the link is being rendered, but doesn't work when the rendered link is clicked to download the resource. It seems that when the link is clicked and the resource is served, something has gone wrong with the JSF lifecycle and FacesContext has become null.

        Show
        yip.ng added a comment - The value binding works when the link is being rendered, but doesn't work when the rendered link is clicked to download the resource. It seems that when the link is clicked and the resource is served, something has gone wrong with the JSF lifecycle and FacesContext has become null.
        Sam Xiao made changes -
        Salesforce Case [50070000007C5ah]
        Hide
        yip.ng added a comment -

        See also Adnan's comments in ICE-3686.

        Show
        yip.ng added a comment - See also Adnan's comments in ICE-3686 .
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18162 Thu Jan 08 17:03:30 MST 2009 yip.ng ICE-3680
        Changed anonymous resource class to a named class to prevent value binding exceptions and memory leaks.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/outputresource/OutputResource.java
        yip.ng made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ken Fyten added a comment -

        Let's see if we can have the component use the Resource's options if specified. They can be augmented by the component options but the Resource's options should take precedence.

        If this isn't readily feasible then we at least need to document the policy in the TLD for the component (in any case the TLD needs to clearly state the policy towards the options behavior).

        Show
        Ken Fyten added a comment - Let's see if we can have the component use the Resource's options if specified. They can be augmented by the component options but the Resource's options should take precedence. If this isn't readily feasible then we at least need to document the policy in the TLD for the component (in any case the TLD needs to clearly state the policy towards the options behavior).
        Ken Fyten made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18166 Mon Jan 12 15:38:01 MST 2009 yip.ng ICE-3680
        Changed to allow the user resource to override some tag attributes using the withOptions() method.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/outputresource/OutputResource.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component-metadata/src/main/resources/conf/ice_cust_properties/cust-outputresource-props.xml
        yip.ng made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Fix Version/s 1.8 [ 10161 ]
        Assignee Priority P1
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Yip Ng [ yip.ng ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Tyler Johnson
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: