basic applet

i am new to applet programming. I copied a sample applet (Clock2.class)to my jsp location. It was successful.

Then I changed the code, cleaned the cache and reloaded the page. Now, it gives two different error messages as follows:

When I have the applet tag

<applet codebase="." code="Clock2.class" width=460 height=160>

</applet>

In the browser:java.land.ClassNotFoundException:Clock2.class

In the status bar:

Opening http://localhost:myport/mypath/Clock2/class.class

<applet codebase="." code="Clock2" width=460 height=160>

</applet>

In the browser: java.land.ClassNotFoundException:Clock2

In the status bar:

Opening http://localhost:myport/mypath/Clock2.class

I have been struggling with this couple days. Any help is greatly appreciated

[858 byte] By [ejbjohn] at [2007-9-27 14:30:14]
# 1

Try:

code="./Clock2.class"

Applets unlike jsp pages do not have to be in a special location on the server since the applet is just down loaded from the server like a static file and then executed on the client machine while jsp pages are executed on the server. In your case the html page should be in the same place as the Clock2.class file, so that the codebase points to the directory containing the applet.

kocha3 at 2007-7-5 22:29:32 > top of Java-index,Desktop,Core GUI APIs...