Codebase in applet tag

hi
Here is my html file
<html>
<body>
<applet codebase = "Coorclasses/" code = "CoordinateConverterApplet.class" archive = "FITSWCS.jar" width=380 height=400></applet>
</body>
</html>
It works fine.In the above case my ".class" file (CoordinateConverterApplet.class) and the archive file(FITSWCS.jar) sits under the same directory(Coorclasses).
My question is can i have my archive file ie.(FITSWCS.jar) in one directory and have my ".class" file(CoordinateConverterApplet.class) in some other directory?if i can have them in different directories how can i give the "codebase attribute" for them because in this case they reside in different directories.
thanks

The browser needs to download the class files just like any other resource (.gif, .css, .js, .html) etc. . .
My guess is that your app server won't let files be served from the WEB-INF (since it is a protected directory who's purpose is configuraiton and SERVER SIDE classes).
jar up all of your applet specific class files and put them in the webapp - but not the WEB-INF dir.
For instance, you may have
webapp-root/
|- index.jsp
|- another_page.jsp
|- applet_page.jsp
|- images
  |- image.gif
  |- applet.jar
|- WEB-INF
  |- classes
  |- lib

Similar Messages

  • applet tag vs Object tag

    As per W3Schools HTML applet tag is not supported in HTML5. Need to use <Object> tag instead of <applet> tag.
    For more details follow this link: http://www.w3schools.com/tags/tag_applet.asp
    http://dev.w3.org/html5/spec/obsolete.html#the-applet-element
    Point 11.2 Non-conforming features
    So, I go ahead and the change the code as below depicted.
    Below code that is working with <APPLET> tag:
    +<Applet+
    style    = "position:absolute;border:0px;left:184;top:95;height:180;width:364;"
    code     = "jtreeviewapplet.JTreeViewAppletMain.class"
    name     = "TreeView"
    id       = "TreeView"
    hspace   = "0"
    vspace   = "0"
    align    = "top"
    archive  = "/Project/HTML/ABC/XYZ.jar,/Project/HTML/ABC/ABC.jar"
    MAYSCRIPT>
    +<PARAM NAME="onSelected" VALUE="onSelect_Handler">+
    +<PARAM NAME="onFinishNormalize" VALUE="onFinishNormalize_Handler">+
    +</Applet>+
    Here is the snippet, whcih have been changed to <OBJECT> tag so as to support HTML5 in future:
    +<OBJECT type=" application/x-java-applet"+
    style    = "position:absolute;border:0px;left:184;top:95;height:180;width:364;"
    name     = "TreeView"
    id       = "TreeView"
    hspace   = "0"
    vspace   = "0"
    align    = "top"
    +>+
    +<PARAM name="code" value=”jtreeviewapplet.JTreeViewAppletMain.class”>+
    +<PARAM name="codebase" value="/Project/HTML/ABC/">+
    +<PARAM name="archive" value=" XYZ.jar">+
    +<PARAM name="archive" value=" ABC.jar">+
    +<PARAM name="scriptable" value="true">+
    +<PARAM NAME="onSelected" VALUE="onSelect_Handler">+
    +<PARAM NAME="onFinishNormalize" VALUE="onFinishNormalize_Handler">+
    +</OBJECT>+
    After changing the *<applet>* tag to *<object>* tag , my applet itself is not loading and it gives class not found exception for jtreeviewapplet.JTreeViewAppletMain.class.
    (Note: For both working and not working condition, I am using latest JDK 1.7 update 9 for compiling the code and in my system I am having latest JRE1.7 update 9 to run the applet code. I am using InternetExplorer 8 and InternetExplorer 9 browser)
    Can anybody help me to find out where I am going wrong?
    Edited by: 975931 on Dec 12, 2012 1:24 AM

    You might want to stick to the documentation:
    http://docs.oracle.com/javase/tutorial/deployment/index.html
    and use the deployment toolkit.
    PS: use \ tags when posting anything code related. That makes it readable and it keeps the forum from trying to interpret it.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Applet tag question

    I am working with applets and have been getting the classdefnotfounderror exception and a wrong name error.
    After pouring over the archives and messing around, I have found a
    solution to my problem, but I don't know why it works. I think it has to do with packages, but I'm not sure.
    I have two versions of Asteroids, one which has "package Asteroids" at the top
    of each file, and one that has no package.
    First with the version that is in a package: If I have the html file in the
    same directory as the class files, I cannot get the applet tag to work
    properly. If I back it up a directory (just outside the Asteroids directory), this works:
    <applet
      codebase = "."
      code     = "Asteroids/Asteroids.class"
      width    = "640"
      height   = "480"
    </applet>
    {code}
    One old post I found said that the wrong name error indicates that the qualified name is incorrect ( so my incorrect name would be Asteroids.class) and that the full name should include the package, so mine would be Asteroids/Asteroids.class, I think. Is that correct? If so, why wouldn't this code work inside the same directory as the class files?
    For the version that is not in a package, the opposite seems to work.
    {code:java}
    <applet
      codebase = "Asteroids/"
      code     = "Asteroids.class"
      width    = "640"
      height   = "480"
    </applet>
    {code}
    This code works for the version which is not in a package, but does not work for the version in a package, ( and vice versa for the code above). It seems like either code should work in either case. What am I missing?
    Thanks,
    Matt                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I don't know what your understanding of packages and applet codebase is. These 2 tutorial sections should clarify your understanding, though.
    http://java.sun.com/docs/books/tutorial/java/package/index.html
    http://java.sun.com/docs/books/tutorial/deployment/applet/html.html

  • APPLET tag missing CODE parameter

    We are planning to use WebStart for our swing_apps deployment. At the moment we use applets with Plug-In 1.3.1_04
    I changed the html as follows:
    <OBJECT CODEBASE="http://java.sun.com/update/1.3.1/jinstall-1_3_1_04-win.cab"
    classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="0" height="0">
    <PARAM NAME="app" VALUE="myServer/myWebApp/wsapps.jnlp">
         <PARAM NAME="back" VALUE="true">
         <!-- Alternate HTML for browsers which cannot instantiate the object -->
         Download Java Web Start
    </OBJECT>
    When loading the page from the server we get following error:
    "APPLET tag missing CODE parameter"
    When I load "myServer/myWebApp/wsapps.jnlp" directly from the browser, the application runs fine.
    any idea's?

    To have web start run your application, it just needs to open the JNLP file in the browser.
    You do not need the OBJECT tag since your are pointing it to a JNLP file and not an applet.
    just use an HREF to your JNLP file
    Run Application
    Dan

  • I have a sample applet tag in my browser

    Here is the applet tag in my browser
    <applet id="Laufschrift1" name="Laufschrift1" code=
    "TickerTape.class" codebase="../../scripts/" height="25"
    width="780">
    What does ../../scripts denote.
    As far as i know CODEBASE = ./ denotes the current directory or the classpath + the classname
    But i have seen CODEBASE = ../../scripts/ for the first time.
    Supposing that the webpage address is www.abc.com then CODEBASE = ../../scripts/ will be ??
    I am new to java and so i need someone's help

    "../" means "the directory above". So "../../scripts/" means "the directory named scripts located in the directory two levels above the current directory."

  • Whats wrong with this applet TAG

    Hi,
    Any ideas why this tag:
    <APPLET
    codebase="/applet"
    archive="JavaLibrary1.jar"
    code="org.gregnet.NewJApplet.class"
    width=350 height=200>
    </APPLET>
    results my web server is giving an error indicating it can't find anything at: "/applet/org/gregnet/NewJApplet.class"?? It's kind of like the ARCHIVE parameter it's being recognised? My web server I assume should only see the applet calling into the "http://<<domain>>/applet/JavaLibrary1.jar" address based on my applet tag (i.e. the code parameter should be used to form part of the HTTP request path I assume)
    Any ideas?

    Try the applet in Appleteer. See if that explains things better.
    Edited by: AndrewThompson64 on Feb 27, 2009 2:58 PM

  • Problem of APPLET TAG

    Hi,
    I created an applet (extends JApplet).
    if the applet is not packaged, it can be displayed properly on HTML page with tag:
    <applet
    codebase="file:///F:/temp/paper"
    code="UserJApplet.class"
    width=400 height=300
    >
    </applet>
    but if It is packaged, it can not be displayed.
    HTML TAG is following:
    <applet
    codebase="file:///F:/temp/paper"
    code="java.test.UserJApplet.class"
    width=400 height=300
    >
    </applet>
    the class is compiled in right directory and package.
    what is wrong?

    Hi,
    I created an applet (extends JApplet).
    if the applet is not packaged, it can be displayed
    properly on HTML page with tag:
    <applet
    codebase="file:///F:/temp/paper"
    code="UserJApplet.class"
    width=400 height=300
    >
    </applet>
    but if It is packaged, it can not be displayed.
    HTML TAG is following:
    <applet
    codebase="file:///F:/temp/paper"
    code="java.test.UserJApplet.class"
    width=400 height=300
    >
    </applet>
    the class is compiled in right directory and
    package.
    I'd try it without setting codebase.
    <applet
    code="UserJApplet.class"
    width=400 height=300
    >
    </applet>The codebase defaults to the Applet base directory
    May not work but worth try.
    (T)

  • Could the applet tag be any more unintuitive?

    I've got an html file that's in the same directory as my jar file, WebUpload.jar.
    WebUpload.jar has the class WebUploadUI.
    The class WebUploadUI is in the package fileTransfer.
    So... what's the applet tag to load this?
    <applet codebase="." code="fileTransfer/WebUploadUI.class" archive="WebUpload.jar" width=250 height=130>
    Doesn't work. I find it hilarious I can write a multithreaded client socket without much trouble but I can't figure this out.

    There are examples and explanations here:
    http://java.sun.com/docs/books/tutorial/deployment/applet/index.html

  • Get JSP file to run with an applet tag under JDeveloper

    I Created an applet and an html file under JDeveloper. with the applet tag in the html file.
    when I run the html file the applet runs perfectly.
    I Created a jsp file in the same project with the applet and the html file under JDeveloper. I copied and pasted the applet tag from the html file to the jsp file.
    When I try to run the jsp file under JDeveloper I get
    java.io.FileNotFoundExceptions for all of the jar files in the Applet tag ARCHIVE and for the applet tag CODE
    This is the applet tag that I copied and pasted from the html file to the jsp file
    BEGIN:
    <APPLET CODE="myapplet.Applet1" ARCHIVE="jdev-rt.jar,ojsp.jar,ojsputil.jar,oc4j.jar,servlet.jar,ojc.jar" HEIGHT="200" WIDTH="200" ALIGN="bottom">This browser does not appear to support Applets.</APPLET>
    END:
    Here three example of the exceptions that I got BEGIN:
    1.
    java.io.FileNotFoundException: http://139.169.225.224:8988/JspToAppletWS-JspAppletInstantiation-context-root/jdev-rt.jar
    2.
    java.io.FileNotFoundException: http://139.169.225.224:8988/JspToAppletWS-JspAppletInstantiation-context-root/jdev-rt.jar
    3.
    java.lang.ClassNotFoundException: myapplet.Applet1
    Here three example of the exceptions that I got END:
    This is the html file that works BEGIN:
    <HTML>
    <HEAD>
    <TITLE>
    Title
    </TITLE>
    </HEAD>
    <BODY>
    <H2>
    This is sample HTML text.
    </H2>
    <BR>
    <APPLET CODE="myapplet.Applet1" ARCHIVE="jdev-rt.jar,ojsp.jar,ojsputil.jar,oc4j.jar,servlet.jar,ojc.jar" HEIGHT="200" WIDTH="200" ALIGN="bottom">This browser does not appear to support Applets.</APPLET>
    </BODY>
    </HTML>
    This is the html file that works END:
    This is the JSP file that does not work BEGIN:
    <!--%@ page contentType="text/html;charset=windows-1252"%-->
    <%@ page import = "myapplet.Applet1, java.util.Enumeration, java.util.Vector, javax.swing.JFrame, java.lang.*" contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>
    Hello World
    </title>
    </head>
    <body>
    <h2>
    The current time is:
    </h2>
    <p>
    <%= new java.util.Date() %></p>
    <APPLET CODE="myapplet.Applet1" ARCHIVE="jdev-rt.jar,ojsp.jar,ojsputil.jar,oc4j.jar,servlet.jar,ojc.jar" HEIGHT="200" WIDTH="200" ALIGN="bottom">This browser does not appear to support Applets.</APPLET-->
    </body>
    </html>
    This is the JSP file that does not work END:
    I would like to know what I need to do so that I can run
    the Jsp file under JDeveloper with the applet tag without any exceptions.

    Hi,
    I meet the same problem and can not get a solution from this forum or other forum in internet, either.
    Have you already solved this problem? Can you tell me your solution? thanks in advance.
    Regards

  • Accessing a File within a zip, which was archived using Applet Tag

    Hi,
    Could Any one please tell me, How to Access a File from within an Applet. The File resides inside a zip which was Archived using <Applet> Tag.
    Actually, I want to write an application which runs both online and offline. So I have chosen Applet and All the files Which I need are zipped and is Archived through <Applet ARCHIVE="example.zip">.
    Now I want to access those XML files which are inside example.zip from my Applet.
    How can I do that?
    I think I will get security Exception.
    How to get rid of this security Exception.
    Kindly Answer soon.......
    It's very urgent.
    Thanking you,
    KumudaRaj

    Did you already try signing a jarfile? If no ->>
    You can call a class inside a jar-file within the applet.
    if this class should be able to acces files the jarfile
    first has to be signed. to do this, you must generate a key.
    the complete work:
    1. write your applet
    2. write a html-page with following code:
    <APPLET code="guestbook.class" archive="guestbook.jar" width=600 height=400></APPLET>
    3. make a zip-file with the guestbook.class, guestbook.form, guestbook$1.class, guestbook$... and rename it to guestbook.jar
    4. in the console type:
    keytool -genkey -alias YOURNAME
    5. sign the key to your jarfile with:
    jarsigner guestbook.jar YOURNAME
    6. try the applet. a warning should appear which you have to answer
    with YES then it should work
    my trouble is that i cant acces files anyway because right now i don�t
    alreadv have the clue to get the right (absolute?) path for the file. means i get an ioexception because the applet cant find the file :-((
    does anyone know how to solve this problem then? my code is:
    FileReader Stream = new FileReader("/members/Ui97u8g4f6b89mj90kh5gbr4ecf6KXC4/guestbook.txt");
    ...

  • APPLET tag issue

    Hello
    When practicing coding applets I am getting the following error message:
    Your browser is completely ignoring the <APPLET> tag.
    Do I need to change a setting in IE?
    Thanks
    Steve

    Hello
    When practicing coding applets I am getting the
    following error message:
    Your browser is completely ignoring the <APPLET>
    tag.
    Do I need to change a setting in IE?
    Thanks
    SteveHello
    Any further suggestions on this please.
    I also have a query concerning Appletviewer. When I try to see my applet through DOS using aooletviewer (as opposed to looking at the HTML page - which doesn't show the applet anyway - maybe this is related to the post I have sent above), it doesn't work. It's as if DOS thinks the appletviwer is not in the c/java/bin directory (but it is).
    Any advice, please.
    Steve

  • Applet tag

    Hi guys i'm having a bit of a problem with an applet.
    I have an applet i am trying to run which imports one of my own classes from a different package. When i run this applet i get a NoClassDefFoundError on this imported class. I dont understand what the problem is, the classpath should be fine, i have had no problem using this class before and although i'm not to familiar with html i don't think i need to mention my imported class in the tag since the std java classes import ok.
    just wondered if anyone could shed some light on the matter.
    I would rather not use a jar file.
    cheers
    steve

    My applet tag looks like:
    <APPLET CODE="MyClass.class" WIDTH=300 HEIGHT=300>
    <\APPLET>
    now the problem i have is that appletviewer, or any of my browsers, cannot find a class 'utilities.MyUtil.class' that i have in a different path, which 'MyClass.class' needs, resulting in a NoClassDefFoundError.
    after looking at an applet tutorial i thought that this maybe impossible without a jar file because of the security restrictions of applets.
    i would be deeply indebted to you if you tell me this is not the case!

  • applet tag regarding JAR file

    Is there something wrong with the following applet declaration?
    <applet code = "Sheep2.class" archive="Sheep2.jar" width = 500 height = 300
    ALT="If you could run this applet, you'd see a sky, a field, and a moon.">
    Your browser is completely ignoring the <APPLET> tag!
    </applet>
    Works fine (it seems) on my Windows 98 computer with IE 6.0280, but does not work on the same computer when I access the page calling the applet using AOL's v.9 browser.
    I used HtmlConverter to convert the above to Extended version (covering all platforms), and still does not work with AOL's browser. HtmlConverter reported no errors, but now IE shows an error icon in its status bar when I access the page even offline.
    Other html files I converted using HtmlConverter work fine with AOL's browser. They don't have "archive" attribute.
    What could be going wrong? My guess is JAR file reference is causing problems.

    I did more Html Conversion today. I ran one file which didn't show any error mark in the status bar of IE through HtmlConverter. I ran the new file generated by HtmlConverter and an error icon appeared in the status bar of IE. My Java Console didn't show any message. So, it must be an error in the applet related info HtmlConverter generated was not 100% html compliant..
    BTW, I started speculating the cause of my applets not working on the computer of oen of my friends is simply that her Java Plug-in cannot handle Swing components' J classes.

  • How to make pack200 work with applet tag ?

    Hello All,
    Sorry for the cross-post.
    I tired getting the advise on java.net forum but with no success. Can someone here please help with this or direct me to right direction.
    I am trying to use the pack200 compressed jars for my Object/Applet tag, but not sure how to go about using it.
    I have followed the instructions for jarsigned pack200 jars.
    http://java.sun.com/j2se/1.5.0/docs/guide/deployme.../deployment-guide/pack200.html
    But now how do i use them in my Object tag, what should i name the files in my cache_archive parameter :
    example:
    something like :
    <PARAM NAME = CACHE_ARCHIVE VALUE = "final.jar" />
    or :
    <PARAM NAME = CACHE_ARCHIVE VALUE = "final.jar.pack.gz" />
    renaming : final.jar.pack.gz --> final.jar ??
    I tried both the above options but none of them works.
    network: Wrote URL http://myserver.net/Stream/lib/final.jar to File C:\Documents and Settings\I025204\Application Data\Sun\Java\Deployment\cache\6.0\60\366763c-2a096009-temp
    java.util.zip.ZipException: ZIP file must have at least one entry
    at java.util.zip.ZipOutputStream.finish(Unknown Source)
    at java.util.zip.DeflaterOutputStream.close(Unknown Source)
    at java.util.zip.ZipOutputStream.close(Unknown Source)
    at com.sun.deploy.net.HttpDownloadHelper.download(Unknown Source)
    at com.sun.deploy.cache.Cache$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)
    at com.sun.deploy.cache.DeployFileOutputStream.close(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown Source)
    at java.io.BufferedInputStream.close(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
    Do i need to add something more .
    I am only allowed to use the below:as its the corporate policy for now.
    Java Plug-in 1.6.0_05
    Using JRE version 1.6.0_05 Java HotSpot(TM) Client VM
    Can someone please help me how to get the pack200 work in the Object tag ?
    Please advise.
    Thanks,

    InputStream in = sc.getResourceAsStream("application.jar.pack.gz");
            OutputStream out = response.getOutputStream();
            if (in != null) {
                try {
                    sendOut(in,out);
                } catch (IOException ioe) {
                    if (ioe.getMessage().compareTo("Broken pipe") == 0) {
                        sc.log("Broken Pipe while writing");
                        return;
                    } else  throw ioe;
            } else response.sendError(response.SC_NOT_FOUND);
    private void sendOut(InputStream in, OutputStream ostream)
                     throws IOException {
            byte buf[] = new byte[8192];
    System.out.println("send jar file");
            int n = in.read(buf);
            while (n > 0 ) {System.out.println(n);
                ostream.write(buf,0,n);
                n = in.read(buf);
            ostream.close();
            in.close();
        }the servlet code is above
    u should conifgure the servlet in the web.xml for urlmapping *.jar
    <servlet-mapping>
          <servlet-name>jarService</servlet-name>
          <url-pattern>*.jar</url-pattern>
        </servlet-mapping>where jarService is the name of the pack200 sevice servlet ContentType.java
    Edited by: kartheepanmirra on Jun 17, 2009 12:17 AM
    Edited by: kartheepanmirra on Jun 17, 2009 3:06 AM

  • JSP applet tag X Html applet tag (what is the difference?)

    what is the advantage in using the JSP applet tag instead of a simple Html applet tag ?
    second question:
    I have an applet in a Html frame, and a menu on the left side.... When the user select the applet option at first time, everything runs ok.. after the user select another option and then select the applet again, it fails in some features .. Why ?

    well, if by "the JSP applet tag", you mean the jsp:plugin tag.. that will just generate the same HTML tag you would write. The only advantage would be it should be less typing to use the taglib.
    second answer:
    without seeing any code, it'd be hard to figure out the problem. The obvious thing is you are setting some state of something that is preventing further action.

Maybe you are looking for

  • Mapping issue in planned Order

    Hi Experts, I am working on a planned order interface(File -> RFC -> File). There is a mapping provided like below in the request, In the request mapping, i am mapping the source structure to the BAPI request. based on the creation/change/cancel requ

  • Thunderbolt docks on snow leopard

    I was thinking about getting one of the thunderbolt docks (belkin, matrox, or caldigit when it comes out). My early 2011 MBP quad i7 2.0 (has thunderbolt port) is running snow leopard and I am reluctant to upgrade. These thunderbolt docks stipulate m

  • No XML Messeges generation in SRM

    Dear Experts, I am working on SRM-SUS scenarion on SRM Server 7.0, I have correctly configured XI  ESOA Scenario  and also transferred vendors from SRM to SUS through SupplierPortalTradingPartner_CreateOrChange_Out messege type but PurchaseOrderReque

  • MainStage "save as" Crash

    I am using mainstage with a macbook pro 2.6 w 4 g of ddr3 I have Ivory, Kontakt 3, & Fab Four instantiated and running nicely. I am using an M-Audio profire 26 connected through a Glyph 500g. They are connected on the firewire bus in this order mac>G

  • Deploy Oracle Webcenter Interaction on Weblogic 10.3 ( Oracle Linux 5)

    Dear All , am trying to deploy Oracle Webcenter Interaction on Oracle Linux Weblogic every thing goes fine with installation but after finishing when we stop on deploy stage on Weblogic what's parameters need to be provided to succcfully deploy the a