0

I have a java web server. One html page serves a java applet! I tested the html file without using the server, it works fine. the html file is placed with a folder named "applets" containing the ".class"

example

.html

<applet code="applets/init.class" width="80%" height="80%> </applet>

My problem is when i pass it through the java server, i get error

ClasNotFoundException
applets.init.class

I have successfully downloaded the .class directly through the browser, which means the server is serving the .class.

Why does the server search for the .class at "applets.init.class" when the actual path is "applets/init.class"

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
user2114721
  • 45
  • 3
  • 7
  • See [how-to-specify-correctly-codebase-and-archive-in-java-applet](http://stackoverflow.com/questions/5947063/how-to-specify-correctly-codebase-and-archive-in-java-applet/5950258#5950258) for the answer. – MockerTim Mar 24 '13 at 15:00
  • 1
    See this link for the class not found exception in applet [http://stackoverflow.com/questions/17690837/class-not-found-exception-on-applet/17690889#17690889][1] – Panchotiya Vipul Jul 17 '13 at 05:49

1 Answers1

0

You have to do it like this:

<applet code="init" codebase="applets/" width="80%" height="80%"> </applet>

Also note the missing " to close the height.

Martijn Courteaux
  • 67,591
  • 47
  • 198
  • 287