Announcement

Collapse
No announcement yet.

WWJ Applet Recommended Setup and Guidelines

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • WWJ Applet Recommended Setup and Guidelines

    We just updated the WWJ applet package for the new java plugin support available since Java 6_10 which improved robustness solves a number of issues. Please find the updated applet package documentation here.

    The following code samples allow you to use the new Java plugin whenever it is available on the client browser and to fall back on the JNLPAppletLauncher otherwise.

    HTML applet declaration for backward compatibility with 'old' plugin using the JNLPAppletLauncher:
    Code:
     <applet code="org.jdesktop.applet.util.JNLPAppletLauncher"
          width=600
          height=400
          archive="http://download.java.net/media/applet-launcher/applet-launcher.jar,
                   http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jar,
                   http://download.java.net/media/gluegen/webstart/gluegen-rt.jar,
                   http://my.web.server.com/WWJApplet/worldwind.jar">
                   http://my.web.server.com/WWJApplet/myapplet.jar">
       <param name="jnlp_href" value="WWJApplet.jnlp"> <!-- Picked up by new plugin -->
       <param name="codebase_lookup" value="false">
       <param name="subapplet.classname" value="gov.nasa.worldwind.examples.applet.WWJApplet">
       <param name="subapplet.displayname" value="World Wind Applet">
       <param name="noddraw.check" value="true">
       <param name="progressbar" value="true">
       <param name="jnlpNumExtensions" value="1">
       <param name="jnlpExtension1"
              value="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp">
     </applet>
    The corresponding WWJApplet.jnlp file:
    Code:
        <?xml version="1.0" encoding="UTF-8"?>
        
           <jnlp href="WWJApplet.jnlp">
            <information>
                <title>World Wind Java Applet Demo</title>
                <vendor>NASA</vendor>
                <homepage href="http://worldwind.arc.nasa.gov"/>
                <description>World Wind Java Applet Demo</description>
                <description kind="short">World Wind Java Applet Demo</description>
                <offline-allowed/>
            </information>
            <security>
                <all-permissions/>
            </security>
             <resources os="Windows">
               <property name="sun.java2d.noddraw" value="true"/>
             </resources>
             <resources>
                <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+" initial-heap-size="512m"
                      max-heap-size="512m"/>
                <property name="sun.java2d.noddraw" value="true"/>
                <jar href="WWJApplet.jar" main="true"/>
                <jar href="worldwind.jar"/>
                <extension name="jogl"
                           href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp"/>
             </resources>
             <!-- Width and heigth are overwritten by the surrounding web page -->
             <applet-desc
                 name="WWJ Applet"
                 main-class="gov.nasa.worldwind.examples.applet.WWJApplet"
                 width="800" height="600">
                <param name="separate_jvm" value="true" />
             </applet-desc>
           </jnlp>
    The Next Generation Plugin allows considerable flexibility in defining the applet context. For instance, a minimal JRE version can be specified along with initial heap memory size (Java 5 and 512M in the above example). A parameter can also direct the plugin to use a different JVM for each applet instance (param separate_jvm above). World Wind applets should always set this parameter and set its value to true.

    As of January 2009 the Next Generation Plugin works with Internet Explorer 6 and 7 on Windows XP or Vista, Firefox 3 on Windows, Solaris and Linux. You can read the new plugin release notes at Release Notes for the Next Generation Java Plug-In Technology.

    When using javascript to java communication it is recommended to use the following javascript code to access the applet:

    Code:
        var theApplet = null;
    
        function getWWJApplet()
        {
           if (theApplet == null) {
              theApplet = document.getElementById('wwjApplet');
           }
           // See if we're using the old Java Plug-In and the JNLPAppletLauncher
           try {
              theApplet = theApplet.getSubApplet();
           } catch (e) {
              // Using new-style applet -- ignore
           }
        return theApplet;
        }
    
        // Call someAppletMethod() via the getWWJApplet() method
    
        getWWJApplet().someAppletMethod();
    My World Wind Java Blog & WW.net Plugins page

  • #2
    As a Newbie, I am always searching online for stuff that can help me. Thank you for your help.
    LMT

    Comment


    • #3
      A small problem with signing

      Greetings:

      I have tried several Applet examples and keep getting this persistent problem, even with the next generation launcher:

      The examples fail to run due to signing problems!

      Either I get failures due to "different jar files in the JNLP being signed with different certs", or in some cases the DLLs have signatures that can't be verified.

      Could someone put in a description of how these problems can be resolved??? Thank you.

      Comment


      • #4
        Originally posted by factor3 View Post
        Greetings:

        I have tried several Applet examples and keep getting this persistent problem, even with the next generation launcher:

        The examples fail to run due to signing problems!

        Either I get failures due to "different jar files in the JNLP being signed with different certs", or in some cases the DLLs have signatures that can't be verified.

        Could someone put in a description of how these problems can be resolved??? Thank you.
        this page has some useful information on using applets.
        The important thing to note is that all jars used by the applet must be signed with the same certificate, as indicated in the error message.

        Comment


        • #5
          Helpful applet info - thank you Patmurris.
          honeymoon registry honeymoon registries honeymoon wedding registry

          Comment


          • #6
            How can I deploy the worldwind.xml and worldwind.layers.xml out of worldwind.jar.

            Comment


            • #7
              Originally posted by vrnew View Post
              How can I deploy the worldwind.xml and worldwind.layers.xml out of worldwind.jar.
              You may use a new worldwind.xml and worldwind.layers.xml in a new jar,and use this jar as main function or applet jar, it's can override the old ones.

              Comment


              • #8
                Originally posted by patmurris View Post
                We just updated the WWJ applet package for the new java plugin support available since Java 6_10 which improved robustness solves a number of issues.
                And what about earlier versions of Java?

                I'm trying to run applet in Linux with Java 1.6.0_0, unfortunatly I cannot use another version. And I have problems to run it. So my question is it any chance for me to run this applet, or I need Java 6 update 10+ to run Applet? Can you please clarify this issue.

                I will appreciate any advice, because problem rather critical for me. Thank you!

                Comment


                • #9
                  thank you Patmurris.

                  แตกใน

                  Comment

                  Working...
                  X