Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    App initialization with loadISC tag

    v8.3d_2012-11-03/PowerEdition Deployment

    I'm trying to setup preloading of resources on the login page. But facing the problem of javascript isc files loaded twise.

    login.jsp
    Code:
    <isc:loadISC skin="Graphite" cacheOnly="true"/>
    Everything goes fine here. Browser log:
    Code:
    [18:41:29.638] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Core.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 200 OK 51мс]
    [18:41:29.687] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Foundation.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 200 OK 12мс]
    [18:41:29.688] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Containers.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 200 OK 8мс]
    [18:41:29.688] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Grids.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 200 OK 44мс]
    [18:41:29.771] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Forms.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 200 OK 34мс]
    [18:41:29.772] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_DataBinding.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 200 OK 31мс]
    [18:41:29.849] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Drawing.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 200 OK 8мс]
    [18:41:29.850] GET http://127.0.0.1:8888/etgcrm/sc/skins/Graphite/load_skin.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 200 OK 18мс]
    [18:41:29.850] GET http://127.0.0.1:8888/etgcrm/sc/skins/Graphite/skin_styles.css?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 200 OK 6мс]
    After successful login, there goes my main jsp

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
        <head>
            <meta http-equiv="content-type" content="text/html; charset=UTF-8">
            <meta name="gwt:property" content="locale=ru_RU">
            <title>MF CRM</title>
            <%
                String buildNumber = ConfigUtils.getBuildNumber();
            %>
            <isc:loadISC skin="Graphite" useSimpleNames="false"/>
            <script type="text/javascript" language="javascript" src="<c:url value="/etgcrm/etgcrm.nocache.js"/>?ver=<%=buildNumber%>"></script>
            <link rel="stylesheet" type="text/css" href="<c:url value="/styles/styles.css"/>?ver=<%=buildNumber%>"/>
        </head>
        <body>
            <script type="text/javascript" src="etgcrm/sc/DataSourceLoader?dataSource=users,departments"></script>
            <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
        </body>
    </html>
    Generated HTML:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
        <head>
            <meta http-equiv="content-type" content="text/html; charset=UTF-8">
            <meta name="gwt:property" content="locale=ru_RU">
            <title>MF CRM</title>
            
            <SCRIPT>window.isomorphicDir='etgcrm/sc/';</SCRIPT>
    <SCRIPT>window.isc_useSimpleNames = false;</SCRIPT>
    <SCRIPT SRC=etgcrm/sc/modules/ISC_Core.js?isc_version=v8.3d_2012-11-03.js></SCRIPT><SCRIPT>isc._lastModule='Core';</SCRIPT>
    <SCRIPT SRC=etgcrm/sc/modules/ISC_Foundation.js?isc_version=v8.3d_2012-11-03.js></SCRIPT><SCRIPT>isc._lastModule='Foundation';</SCRIPT>
    <SCRIPT SRC=etgcrm/sc/modules/ISC_Containers.js?isc_version=v8.3d_2012-11-03.js></SCRIPT><SCRIPT>isc._lastModule='Containers';</SCRIPT>
    <SCRIPT SRC=etgcrm/sc/modules/ISC_Grids.js?isc_version=v8.3d_2012-11-03.js></SCRIPT><SCRIPT>isc._lastModule='Grids';</SCRIPT>
    <SCRIPT SRC=etgcrm/sc/modules/ISC_Forms.js?isc_version=v8.3d_2012-11-03.js></SCRIPT><SCRIPT>isc._lastModule='Forms';</SCRIPT>
    <SCRIPT SRC=etgcrm/sc/modules/ISC_DataBinding.js?isc_version=v8.3d_2012-11-03.js></SCRIPT><SCRIPT>isc._lastModule='DataBinding';</SCRIPT>
    <SCRIPT SRC=etgcrm/sc/modules/ISC_Drawing.js?isc_version=v8.3d_2012-11-03.js></SCRIPT><SCRIPT>isc._lastModule='Drawing';</SCRIPT>
    <SCRIPT SRC=etgcrm/sc/skins/Graphite/load_skin.js?isc_version=v8.3d_2012-11-03.js></SCRIPT>
    
            
            <script type="text/javascript" language="javascript" src="/etgcrm/etgcrm.nocache.js?ver=Temp"></script>
            <link rel="stylesheet" type="text/css" href="/styles/styles.css?ver=Temp"/>
        </head>
        <body>
            <!--Датасорсы-->
            <script type="text/javascript" src="etgcrm/sc/DataSourceLoader?dataSource=users,departments"></script>
            <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
        </body>
    </html>
    Seems like loadISC doing it's job fine, but after loadISC, all the script files are loaded once again by etgcrm.nocache.js (which contains call to initsc.js), browser log:
    Code:
    [18:47:07.559] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Core.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 304 Not Modified 1мс]
    [18:47:07.559] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Foundation.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 304 Not Modified 2мс]
    [18:47:07.560] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Containers.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 304 Not Modified 1мс]
    [18:47:07.560] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Grids.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 304 Not Modified 2мс]
    [18:47:07.561] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Forms.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 304 Not Modified 5мс]
    [18:47:07.561] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_DataBinding.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 304 Not Modified 4мс]
    [18:47:07.562] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Drawing.js?isc_version=v8.3d_2012-11-03.js [HTTP/1.1 304 Not Modified 3мс]
    [18:47:07.562] GET http://127.0.0.1:8888/etgcrm/etgcrm.nocache.js?ver=Temp [HTTP/1.1 200 OK 5мс]
    [18:47:07.563] GET http://127.0.0.1:8888/styles/styles.css?ver=Temp [HTTP/1.1 200 OK 4мс]
    [18:47:07.564] GET http://127.0.0.1:8888/etgcrm/sc/DataSourceLoader?dataSource=users,departments [HTTP/1.1 200 OK 17мс]
    [18:47:07.830] GET http://127.0.0.1:8888/etgcrm/sc/skins/Graphite/skin_styles.css [HTTP/1.1 200 OK 6мс]
    [18:47:11.010] GET http://127.0.0.1:8888/etgcrm/sc/initsc.js [HTTP/1.1 200 OK 3мс]
    [18:47:11.011] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Core.js [HTTP/1.1 200 OK 49мс]
    [18:47:11.011] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Foundation.js [HTTP/1.1 200 OK 50мс]
    [18:47:11.012] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Containers.js [HTTP/1.1 200 OK 9мс]
    [18:47:11.013] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Grids.js [HTTP/1.1 200 OK 74мс]
    [18:47:11.014] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Forms.js [HTTP/1.1 200 OK 48мс]
    [18:47:11.014] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_RichTextEditor.js [HTTP/1.1 200 OK 7мс]
    [18:47:11.015] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_Calendar.js [HTTP/1.1 200 OK 16мс]
    [18:47:11.015] GET http://127.0.0.1:8888/etgcrm/sc/modules/ISC_DataBinding.js [HTTP/1.1 200 OK 48мс]
    [18:47:11.016] GET http://127.0.0.1:8888/etgcrm/sc/skins/Graphite/load_skin.js [HTTP/1.1 200 OK 74мс]
    You can see, that there are dublicate calls to all ics js-files without verson nunmber parameter => they are not loaded from browser cache.

    Removing <isc:loadISC/> from main jsp (and manually setting isomorphicDir) leaves single load of scripts, but still without version number parameter.

    Do i miss something?

    TY.
    Last edited by vostapenko; 5 Nov 2012, 09:11.

    #2
    You can either:

    a) use *NoScript versions of the SmartGWT modules you are inheriting and add manual <script> tags to your host .html files with match versions

    OR

    b) set isc.addVersionToLoadTags to false in server.properties

    Adding a version to the URL can make upgrades easier (no possibility the client is caching old versions).

    Comment


      #3
      Thanks, inheriting SmartGwtPowerNoScript while continuing using

      <isc:loadISC skin="Graphite" useSimpleNames="false"/>

      at the main page helped.

      But now i have two warnings in the developer console:

      Code:
      06:00:41.676:INFO:Log:initialized
      06:00:41.911:WARN:Log:New Class ID: 'IAutoFitButton' collides with ID of existing Class object '[Class IAutoFitButton]'.  Existing object will be replaced.
      06:00:41.911:WARN:Log:New Class ID: 'HeaderMenuButton' collides with ID of existing Class object '[Class HeaderMenuButton]'.  Existing object will be replaced.
      06:00:47.739:INFO:Log:isc.Page is loaded
      There were no warnings, while i was inheriting SmartGwtPowerNoTheme.

      Should i consider it a problem?

      Comment


        #4
        That probably indicates two skins, or two copies of the same skin, are being loaded. Look for two loads of load_skin.js.

        Comment

        Working...
        X