6 Replies Latest reply: Feb 23, 2010 8:15 PM by 793415 RSS

    deployJava when not connected to network

    843804
      Hi

      I am trying to create a web page that contains an applet. These pages can be stored on servers or local disks. If the page is on the local disk, I would like to have it viewable whether or not the internet is connected or not.

      Also, I would like to have the page prompt for the installation of Java if it is not yet installed.

      I use to be able to fullfil both of these requirements with the <object> tag, such as
            <object
                classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                codebase = "http://java.sun.com/update/1.4.2/jinstall-1_4-windows-i586.cab#Version=1,4,0,0"
                etc....
      If java was already installed then it would start the applet, even if the network was not connected. The new recommended practice is to use the deployJava.js script. The problem is that deployJava is always run, and if the network is down then the script hangs up and the applet fails to load (even if all of the required bits of the JRE are present).

      Is there a recommended way to do what I want? Install java if required, but allow machines with no network connections to still run the applets?

      Thanks,

      Tom
        • 1. Re: deployJava when not connected to network
          793415
          tmoore41 wrote:
          ..I am trying to create a web page that contains an applet. These pages can be stored on servers or local disks. If the page is on the local disk, I would like to have it viewable whether or not the internet is connected or not.
          If you want it to run off pages on the local disk, it is a mystery to me why you do not:
          a) Launch it using webstart from the internet (specifying offline-allowed)
          b) Then convert it to a JFrame.
          • 2. Re: deployJava when not connected to network
            843804
            Thanks for the quick reply Andrew. I don't quite understand your solution, or maybe you don't quite understand my problem. I have a series of web pages, some of them contain applets. This is not a monolithic RIA. I would like to be able to navigate through the web pages on the internet, or off of a CD or local disk with or without internet access. If the client has no internet access I would like the web pages to load if possible. If they do have internet access but no java then I would like to make it easier for them to install java.

            When you say "Launch it using webstart" what do you mean by 'it'? The web page?

            When you say "convert it to a JFrame" what do you mean by 'it'? That I should convert the applet to embed in a JFrame rather than within the web page? What about the web page content (multiple pages)?

            At this stage I can think of two options
            1) Don't do anything special to help load java, and just delegate this problem to the browser or user. I am not sure what values I should use for the classid and codebase attributes to the <object> tag however. The values I have now specify 1.4.2 and are very out of date. I cannot find any documentation for up to date values.
            2) Redistribute 'deployJava.js' with my set of web pages so that it is always local. Is this allowed? Will it work this way?

            Solution 1 seems preferred, but where do I find documentation about classid and codebase for java versions?
            • 3. Re: deployJava when not connected to network
              793415
              tmoore41 wrote:
              Thanks for the quick reply Andrew. I don't quite understand your solution, or maybe you don't quite understand my problem. I have a series of web pages, some of them contain applets. This is not a monolithic RIA. I would like to be able to navigate through the web pages on the internet, or off of a CD or local disk with or without internet access. If the client has no internet access I would like the web pages to load if possible. If they do have internet access but no java then I would like to make it easier for them to install java.

              When you say "Launch it using webstart" what do you mean by 'it'? The web page?
              Webstart is only for launching applets (or applications), it definitely does not launch web pages. Your description of a 'monolithic RIA' makes me reconsider the benefit of my advice. Truth is, a lot of people have applets embedded in web pages for no good reason - whereas from your description, it seems that is not the case for your web-app. If the applets (for example) interact with the web page via. JS - that is not a functionality that webstart can emulate/handle.

              I'm going to leave this thread open as a tab in my browser. Tomorrow I'll review it and see if I can come up with information/strategies more useful to you.
              • 4. Re: deployJava when not connected to network
                793415
                AndrewThompson64 wrote:
                ...I'll review it and see if I can come up with information/strategies more useful to you.
                Try using a local copy of deployJava.js.
                • 5. Re: deployJava when not connected to network
                  843804
                  Ok, I'll give it a try just to see what happens. I am not sure that this is such a good solution however:
                  1) I am not sure that I have permission to redistribute deployJava.js with my project. What is the license for it? When I download the script it has been stripped of all comments.
                  2) How can I ensure that the installation methods will be kept up to date If I 'hard code' the deployment methods by distributing them myself? Are there specific version dependencies within the deployJava.js script that need to be updated once in a while? I am guessing that one of the design elements of the 'deployJava.js' script is that since it is on a sun server it can be kept up to date over time. This cannot happen once it is frozen in to my distribution.

                  It would be nice if deployJava.js checked if the java install was adequate, and if not then went out to the network to get instructions on what to do next. It is too hard for me to tell what is going on in the whitespaced-stripped file however. Any internal documentation on what deployJava.js does?
                  • 6. Re: deployJava when not connected to network
                    793415
                    tmoore41 wrote:
                    Ok, I'll give it a try just to see what happens. I am not sure that this is such a good solution however:
                    1) I am not sure that I have permission to redistribute deployJava.js with my project. What is the license for it? When I download the script it has been stripped of all comments.
                    Good question. I had to chase up the webmaster of mindprod.com to alter his pages to reflect that the preferred method was to hot-link to Sun's own script. It never occured to me to question that Sun might not allow not hot-linking to the script. Now I go looking over their documentation on the script, it is not really clear.

                    The documentation I was looking through, can be found at the [Java™ Rich Internet Applications Deployment Advice|http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html] page.
                    2) How can I ensure that the installation methods will be kept up to date If I 'hard code' the deployment methods by distributing them myself?
                    You can't. That is one downside of using a copy of the script.
                    .. Are there specific version dependencies within the deployJava.js script that need to be updated once in a while?
                    Not that I know of. Though Sun might upload changes to correct bugs in various browsers.
                    I am guessing that one of the design elements of the 'deployJava.js' script is that since it is on a sun server it can be kept up to date over time. This cannot happen once it is frozen in to my distribution.
                    Well summed up.
                    It would be nice if deployJava.js checked if the java install was adequate, and if not then went out to the network to get instructions on what to do next. It is too hard for me to tell what is going on in the whitespaced-stripped file however. Any internal documentation on what deployJava.js does?
                    See what you can figure from the link above, and related documentation.