ICEfaces
  1. ICEfaces
  2. ICE-7444

Add uniqueResourceURLs feature to mandatoryResource enabled comps

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1-Beta2
    • Fix Version/s: 3.0.RC1, 3.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      server
    • Assignee Priority:
      P1

      Description

      Extend the uniqueResourceURLs feature to the resources used by the components.

        Activity

        Hide
        Mircea Toma added a comment - - edited

        Modified BridgeSetup to use JavascriptOutputResource-s for all resources including the mandatoryResources registered by components. Changed JavascriptOutputResource dynamic component to create these resources then append the extra query parameter used for cache invalidation. Stopped relying on the default script renderer for the JS resource since both Mojara and Myfaces implementations are not flexible enough to provide the required behaviour.
        Removed MyFacesResourceHandlerFix resource handler since the createResource(...) method is called by JavascriptOutputResource without the extra parameter avoiding any confusion in the JSF implementation.

        Show
        Mircea Toma added a comment - - edited Modified BridgeSetup to use JavascriptOutputResource-s for all resources including the mandatoryResources registered by components. Changed JavascriptOutputResource dynamic component to create these resources then append the extra query parameter used for cache invalidation. Stopped relying on the default script renderer for the JS resource since both Mojara and Myfaces implementations are not flexible enough to provide the required behaviour. Removed MyFacesResourceHandlerFix resource handler since the createResource(...) method is called by JavascriptOutputResource without the extra parameter avoiding any confusion in the JSF implementation.
        Hide
        Ken Fyten added a comment -

        Re-open.

        Mark has discovered that the @MandatoryResourceComponent annotations are being handled differently than the regular @ResourceDependency processing. The @MandatoryResourceComponent ones are getting the "&v=1255606960" appended, but not the @ResourceDependency ones for the component actually on the page.

        Details:

        With the icefaces 3 application I had this mandatoryResourceConfiguration in my web.xml, and then visited the ace:dateTimeEntry page.

        <context-param>
        <param-name>org.icefaces.mandatoryResourceConfiguration</param-name>
        <param-value>org.icefaces.ace.component.accordion.Accordion org.icefaces.ace.component.celleditor.CellEditor org.icefaces.ace.component.contextmenu.ContextMenu org.icefaces.ace.component.dataexporter.DataExporter </param-value>
        </context-param>

        These are the redundant pairs of javascript that I found. They correspond to the @ResourceDependency annotations for dateTimeEntry, the component on the page. This shows that the @MandatoryResourceComponent annotations are being handled differently than the regular @ResourceDependency processing. The @MandatoryResourceComponent ones are getting the "&v=1255606960" appended, but not the @ResourceDependency ones for the component actually on the page.

        <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/jquery.js.jsf?ln=icefaces.ace"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/jquery.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id6"></script>

        <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/ui/jquery-ui.js.jsf?ln=icefaces.ace"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/ui/jquery-ui.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id7"></script>

        <script type="text/javascript" src="/showcase/javax.faces.resource/core/core.js.jsf?ln=icefaces.ace"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/core/core.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id8"></script>

        <script type="text/javascript" src="/showcase/javax.faces.resource/yahoo-dom-event/yahoo-dom-event.js.jsf?ln=yui/2_8_2"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/yahoo-dom-event/yahoo-dom-event.js.jsf?ln=yui/2_8_2&v=1255606960" id="j_id10"></script>

        <script type="text/javascript" src="/showcase/javax.faces.resource/element/element-min.js.jsf?ln=yui/2_8_2"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/element/element-min.js.jsf?ln=yui/2_8_2&v=1255606960" id="j_id11"></script>

        <script type="text/javascript" src="/showcase/javax.faces.resource/util/combined.js.jsf?ln=icefaces.ace"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/util/combined.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id13"></script>

        Here's the full head tag:

        <head>
        <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/themes/sam/theme.css.jsf?ln=icefaces.ace">
        <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/demo_template.css.jsf?ln=css">
        <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/override_styles.css.jsf?ln=css">
        <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/showcase_styles.css.jsf?ln=css">
        <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/forms/forms.css.jsf?ln=icefaces.ace">
        <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/jquery/ui/jquery-ui.css.jsf?ln=icefaces.ace">
        <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/jquery.js.jsf?ln=icefaces.ace"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/ui/jquery-ui.js.jsf?ln=icefaces.ace"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/core/core.js.jsf?ln=icefaces.ace"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/datetimeentry/datetimeentry.js.jsf?ln=icefaces.ace"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/yahoo-dom-event/yahoo-dom-event.js.jsf?ln=yui/2_8_2"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/element/element-min.js.jsf?ln=yui/2_8_2"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/tabview/tabview-min.js.jsf?ln=yui/2_8_2"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/util/combined.js.jsf?ln=icefaces.ace"></script>
        <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/util/combined.css.jsf?ln=icefaces.ace">
        <script type="text/javascript" src="/showcase/javax.faces.resource/jsf.js.jsf?ln=javax.faces&v=1255606960" id="j_id3"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/icepush.js.jsf?v=1255606960" id="j_id4"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/bridge.js.jsf?v=1255606960" id="j_id5"></script>

        <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/jquery.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id6"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/ui/jquery-ui.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id7"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/core/core.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id8"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/accordion/accordion.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id9"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/yahoo-dom-event/yahoo-dom-event.js.jsf?ln=yui/2_8_2&v=1255606960" id="j_id10"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/element/element-min.js.jsf?ln=yui/2_8_2&v=1255606960" id="j_id11"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/button/button-min.js.jsf?ln=yui/2_8_2&v=1255606960" id="j_id12"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/util/combined.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id13"></script>
        <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/checkboxbutton/checkboxbutton.css.jsf?ln=icefaces.ace">
        <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/button/assets/button-core.css.jsf?ln=yui/2_8_2">
        <script type="text/javascript" src="/showcase/javax.faces.resource/confirmationdialog/confirmationdialog.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id14"></script>
        <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/wijmo/wijmo.css.jsf?ln=icefaces.ace">
        <script type="text/javascript" src="/showcase/javax.faces.resource/wijmo/wijmo.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id15"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/menu/menu.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id16"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/dataexporter/dataexporter.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id17"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/compat.js.jsf"></script>
        <script type="text/javascript" src="/showcase/javax.faces.resource/icefaces-compat.js.jsf"></script>
        <title id="title">ICEfaces Showcase</title>
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type="text/css" rel="stylesheet" href="./xmlhttp/css/rime/rime.css"></head>

        Show
        Ken Fyten added a comment - Re-open. Mark has discovered that the @MandatoryResourceComponent annotations are being handled differently than the regular @ResourceDependency processing. The @MandatoryResourceComponent ones are getting the "&v=1255606960" appended, but not the @ResourceDependency ones for the component actually on the page. Details: With the icefaces 3 application I had this mandatoryResourceConfiguration in my web.xml, and then visited the ace:dateTimeEntry page. <context-param> <param-name>org.icefaces.mandatoryResourceConfiguration</param-name> <param-value>org.icefaces.ace.component.accordion.Accordion org.icefaces.ace.component.celleditor.CellEditor org.icefaces.ace.component.contextmenu.ContextMenu org.icefaces.ace.component.dataexporter.DataExporter </param-value> </context-param> These are the redundant pairs of javascript that I found. They correspond to the @ResourceDependency annotations for dateTimeEntry, the component on the page. This shows that the @MandatoryResourceComponent annotations are being handled differently than the regular @ResourceDependency processing. The @MandatoryResourceComponent ones are getting the "&v=1255606960" appended, but not the @ResourceDependency ones for the component actually on the page. <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/jquery.js.jsf?ln=icefaces.ace"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/jquery.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id6"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/ui/jquery-ui.js.jsf?ln=icefaces.ace"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/ui/jquery-ui.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id7"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/core/core.js.jsf?ln=icefaces.ace"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/core/core.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id8"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/yahoo-dom-event/yahoo-dom-event.js.jsf?ln=yui/2_8_2"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/yahoo-dom-event/yahoo-dom-event.js.jsf?ln=yui/2_8_2&v=1255606960" id="j_id10"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/element/element-min.js.jsf?ln=yui/2_8_2"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/element/element-min.js.jsf?ln=yui/2_8_2&v=1255606960" id="j_id11"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/util/combined.js.jsf?ln=icefaces.ace"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/util/combined.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id13"></script> Here's the full head tag: <head> <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/themes/sam/theme.css.jsf?ln=icefaces.ace"> <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/demo_template.css.jsf?ln=css"> <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/override_styles.css.jsf?ln=css"> <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/showcase_styles.css.jsf?ln=css"> <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/forms/forms.css.jsf?ln=icefaces.ace"> <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/jquery/ui/jquery-ui.css.jsf?ln=icefaces.ace"> <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/jquery.js.jsf?ln=icefaces.ace"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/ui/jquery-ui.js.jsf?ln=icefaces.ace"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/core/core.js.jsf?ln=icefaces.ace"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/datetimeentry/datetimeentry.js.jsf?ln=icefaces.ace"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/yahoo-dom-event/yahoo-dom-event.js.jsf?ln=yui/2_8_2"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/element/element-min.js.jsf?ln=yui/2_8_2"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/tabview/tabview-min.js.jsf?ln=yui/2_8_2"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/util/combined.js.jsf?ln=icefaces.ace"></script> <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/util/combined.css.jsf?ln=icefaces.ace"> <script type="text/javascript" src="/showcase/javax.faces.resource/jsf.js.jsf?ln=javax.faces&v=1255606960" id="j_id3"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/icepush.js.jsf?v=1255606960" id="j_id4"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/bridge.js.jsf?v=1255606960" id="j_id5"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/jquery.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id6"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/jquery/ui/jquery-ui.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id7"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/core/core.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id8"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/accordion/accordion.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id9"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/yahoo-dom-event/yahoo-dom-event.js.jsf?ln=yui/2_8_2&v=1255606960" id="j_id10"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/element/element-min.js.jsf?ln=yui/2_8_2&v=1255606960" id="j_id11"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/button/button-min.js.jsf?ln=yui/2_8_2&v=1255606960" id="j_id12"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/util/combined.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id13"></script> <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/checkboxbutton/checkboxbutton.css.jsf?ln=icefaces.ace"> <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/button/assets/button-core.css.jsf?ln=yui/2_8_2"> <script type="text/javascript" src="/showcase/javax.faces.resource/confirmationdialog/confirmationdialog.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id14"></script> <link type="text/css" rel="stylesheet" href="/showcase/javax.faces.resource/wijmo/wijmo.css.jsf?ln=icefaces.ace"> <script type="text/javascript" src="/showcase/javax.faces.resource/wijmo/wijmo.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id15"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/menu/menu.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id16"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/dataexporter/dataexporter.js.jsf?ln=icefaces.ace&v=1255606960" id="j_id17"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/compat.js.jsf"></script> <script type="text/javascript" src="/showcase/javax.faces.resource/icefaces-compat.js.jsf"></script> <title id="title">ICEfaces Showcase</title> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type="text/css" rel="stylesheet" href="./xmlhttp/css/rime/rime.css"></head>
        Hide
        Mircea Toma added a comment -

        Stop adding mandatory resources if previously added by other components using vanilla @ResourceDependency annotations.

        Show
        Mircea Toma added a comment - Stop adding mandatory resources if previously added by other components using vanilla @ResourceDependency annotations.
        Hide
        Mircea Toma added a comment -

        Replace mandatory resources if previously added by other components using vanilla @ResourceDependency annotation. This way the reference resources will get the extra "v=" parameter, used to invalidate caching.

        Show
        Mircea Toma added a comment - Replace mandatory resources if previously added by other components using vanilla @ResourceDependency annotation. This way the reference resources will get the extra "v=" parameter, used to invalidate caching.
        Hide
        Deryk Sinotte added a comment -

        With MyFaces, the changes from this case cause. The set of resources is technically documented as being unmodifiable.

        java.lang.UnsupportedOperationException
        java.util.Collections$UnmodifiableList.set(Collections.java:1156)
        org.icefaces.impl.event.BridgeSetup.addOrReplaceResource(BridgeSetup.java:378)
        org.icefaces.impl.event.BridgeSetup.processEvent(BridgeSetup.java:100)
        javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
        org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2150)
        org.apache.myfaces.application.ApplicationImpl.access$000(ApplicationImpl.java:118)
        org.apache.myfaces.application.ApplicationImpl$SystemListenerEntry.publish(ApplicationImpl.java:2340)
        org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:563)
        javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:454)
        javax.faces.component.UIViewRoot.encodeBegin(UIViewRoot.java:368)
        javax.faces.component.UIComponent.encodeAll(UIComponent.java:670)
        org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1695)
        org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:281)
        org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:90)
        org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
        javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)

        Show
        Deryk Sinotte added a comment - With MyFaces, the changes from this case cause. The set of resources is technically documented as being unmodifiable. java.lang.UnsupportedOperationException java.util.Collections$UnmodifiableList.set(Collections.java:1156) org.icefaces.impl.event.BridgeSetup.addOrReplaceResource(BridgeSetup.java:378) org.icefaces.impl.event.BridgeSetup.processEvent(BridgeSetup.java:100) javax.faces.event.SystemEvent.processListener(SystemEvent.java:43) org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2150) org.apache.myfaces.application.ApplicationImpl.access$000(ApplicationImpl.java:118) org.apache.myfaces.application.ApplicationImpl$SystemListenerEntry.publish(ApplicationImpl.java:2340) org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:563) javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:454) javax.faces.component.UIViewRoot.encodeBegin(UIViewRoot.java:368) javax.faces.component.UIComponent.encodeAll(UIComponent.java:670) org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1695) org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:281) org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:90) org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239) javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
        Hide
        Mircea Toma added a comment -

        Replace the component resource by copying the unmodifiable list of component resources into a modifiable list, replace the component into this list, remove all the component resources from the view root and then add them back in the correct order from the copied list.

        Show
        Mircea Toma added a comment - Replace the component resource by copying the unmodifiable list of component resources into a modifiable list, replace the component into this list, remove all the component resources from the view root and then add them back in the correct order from the copied list.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Mircea Toma
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: