3 Replies Latest reply on Jan 2, 2012 11:00 PM by javatwo

    Lots of scripts added when not needed

    javatwo

      I build a website using Richfaces 3.3 running on JBoss 5.1. When a home page is using h:outputLink only, the page source code contains the

      following which is not needed. So the first time users visits the website, it takes lots of time to load the page, giving users bad experience with the website. Is there a way to tell Richfaces not to add the scripts/css that are not needed for the page? Thanks for help. Dave

       

      <link class="component" href="/a4j/s/3_3_1.GAorg/richfaces/renderkit/html/css/basic_both.xcss/DATB/eAGbo7-tNnT5DGkAEXoDrg__.do" rel="stylesheet" type="text/css" />

      <link class="component" href="/a4j/s/3_3_1.GAorg/richfaces/renderkit/html/css/extended_both.xcss/DATB/eAGbo7-tNnT5DGkAEXoDrg__.do" media="rich-extended-skinning" rel="stylesheet" type="text/css" /><script src="/a4j/g/3_3_1.GAorg.ajax4jsf.javascript.AjaxScript.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAorg.ajax4jsf.javascript.PrototypeScript.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAorg.ajax4jsf.javascript.ImageCacheScript.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAorg/ajax4jsf/javascript/scripts/form.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/browser_info.js.do" type="text/javascript"></script><script src="/a4j/g/3_3_1.GAscripts/simpleTogglePanel.js.do" type="text/javascript"></script><link class="component" href="/a4j/s/3_3_1.GAcss/simpleTogglePanel.xcss/DATB/eAGbo7-tNnT5DGkAEXoDrg__.do" rel="stylesheet" type="text/css" />

      <script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/events.js.do" type="text/javascript"></script><script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/utils.js.do" type="text/javascript"></script><script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/json/json-dom.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/scriptaculous/effects.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/jquery/jquery.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/JQuerySpinBtn.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/calendar.js.do" type="text/javascript"></script>

      <link class="component" href="/a4j/s/3_3_1.GAorg/richfaces/renderkit/html/css/calendar.xcss/DATB/eAGbo7-tNnT5DGkAEXoDrg__.do" rel="stylesheet" type="text/css" />

      <script src="/a4j/g/3_3_1.GAscripts/ShuttleUtils.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAscripts/SelectItem.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAscripts/PickListSI.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAscripts/LayoutManager.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAscripts/Control.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAscripts/ListBase.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAscripts/OrderingList.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAscripts/ListShuttle.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAscripts/PickList.js.do" type="text/javascript"></script>

      <link class="component" href="/a4j/s/3_3_1.GAcss/picklist.xcss/DATB/eAGbo7-tNnT5DGkAEXoDrg__.do" rel="stylesheet" type="text/css" /><script src="/a4j/g/3_3_1.GAscripts/tiny_mce/tiny_mce_src.js.do" type="text/javascript"></script><script src="/a4j/g/3_3_1.GAscripts/editor.js.do" type="text/javascript"></script>

      <link class="component" href="/a4j/s/3_3_1.GAcss/editor.xcss/DATB/eAGbo7-tNnT5DGkAEXoDrg__.do" rel="stylesheet" type="text/css" /><script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/modalPanel.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/modalPanelBorders.js.do" type="text/javascript"></script>

      <link class="component" href="/a4j/s/3_3_1.GAorg/richfaces/renderkit/html/css/modalPanel.xcss/DATB/eAGbo7-tNnT5DGkAEXoDrg__.do" rel="stylesheet" type="text/css" />

      <script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/available.js.do" type="text/javascript"></script>

      <script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/script/controlUtils.js.do" type="text/javascript"></script>

      <script type="text/javascript">window.RICH_FACES_EXTENDED_SKINNING_ON=true;</script>

      <script src="/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/skinning.js.do" type="text/javascript"></script>

        • 1. Re: Lots of scripts added when not needed
          javatwo

          if <a4j:commandLink> is in the view tree, but not rendered, ie. rendered=false

          will related a4j scripts will be added to the page source?

           

          Thanks,

          Dave

          • 2. Re: Lots of scripts added when not needed
            javatwo

            After I removed all a4j and richfaces components, these scripts/css are still added to every page.

            A4j is enabled in web.xml.

             

            For our website, management interface is ajax enbled using a4j.

            but website pages is not ajax enabled, so a4j related resources should not be

            added to these pages for fast loading.

             

            Any ideas for achieving this? Thanks very much.

            Dave

            • 3. Re: Lots of scripts added when not needed
              javatwo

              org.ajax4jsf.Filter adds the css/javascript to the request response.

              But I could not find such code in the Filter java code. Could anyone help me?

               

              Thanks,

              Dave