简体   繁体   中英

Java Applet and Html 5

Hi I am trying to embed a java applet in a HTML 5 page. But I keep getting a class not found error.

I have 3 files all part of package applet in larger project. I compile the *.java files, then package up with the following command.

jar cfm0  DataUpload.jar manifest *.class

manifest file

 Manifest-Version: 1.0
 Permissions: all-permissions
 Codebase: *
 Application-Name: DataUpload

Sign and place the jar in root dir of the HTML page and call the applet with the following code.

<object type="application/x-java-applet" name="DataUpload" width="500" height="300">
  <param name="name" value="DataUpload" />
  <param name="archive" value="DataUpload.jar" />
  <param name="code" value="DataUpload.applet.DataUpload" />
  <param name="scriptable" value="true" />
  <param name="codebase_lookup" value="false" />
  <param name="mayscript" value="true" />
  <param name="plugindetect" value="1" />
</object>

Now I think its a problem with code because I was getting wrong name without the applet.DataUpload section. So I added the DataUpload As the base jar address.However no progress

Any help would be very useful

Change <param name="code" value="DataUpload.applet.DataUpload" /> to <param name="code" value="DataUpload" /> and make sure your applet isn't actually in a package. If your code is in a package, then your jar command needs to reflect that (you would need to preserve the folder hierarchy to preserve the package name).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM