This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

load:class sampleapplet.HelloApplet not found

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I am a beginner in applet. I'm creating a web based application. I created a simple applet named "sampleapplet.HelloApplet" and a TestApplet.html page to run it, like this

<html>
<head>
<title> HTML Test Page </title>
</head>
<body>
sampleapplet.HelloApplet will appear below in a Java enabled browser.
<br><br>
<applet
codebase = "."
code = "sampleapplet.HelloApplet.class"
name = "TestApplet"
width = "400"
height = "300"
hspace = "0"
vspace = "0"
align = "middle"
>
</applet>
</body>
</html>

I can start it by openning the TestApplet.html directly. When I try to run it under the Tomocat, it threw error "load:class sampleapplet.HelloApplet not found". I have copied "sampleapplet.HelloApplet.class" into the WEB-INF\classes.

Can any one suggest me to deploy it correctly?

Thnaks,
Jason Li
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Applets are not servlets, and are not related to web applications in the Servlet/JSP sense (and thus the classes don't go into a WEB-INF directory). Your applet classes need to be in the same directory as the HTML file that references them. Or, in your case where you are using a package, in a subdirectory called 'sampleapplet'.
 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Think too about an archive applet parameter (a *.jar file) less trafic!

Peter
reply
    Bookmark Topic Watch Topic
  • New Topic