• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Applet notinted error when imbedded in servlet html output

 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, Im really annoyed here & dont have aclue what the heck is the problem. I have this stupid little test applet that runs fine in appletviewer, fine in a browser when just using an html page but the minute I put the applet tag into the html for a servlet I get applet MessageAlerter notinited.... what the heck is wrong here. Ive even tried putting it in several places in the server file structure (the root, & the classes folder) just to try & figure it out & nothing seems to work!
Applet:
import java.awt.*;
import java.awt.event.*;
public class MessageAlerter extends java.applet.Applet {
public void paint(Graphics g){
g.drawString("Testing 1,2,3", 10, 10);
}
};
Code in html:
<APPLET code='MessageAlerter.class' width='200' height='100'></APPLET>
Like I said it works fine in a browser when I make an html page for it & it works fine in appletviewer...
 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I put the applet tag into the html for a servlet I get applet MessageAlerter notinited....


Have you checked the code generated by the servlet coming onto your browser by rt.click/view source?


Ive even tried putting it in several places in the server file structure (the root, & the classes folder) just to try & figure it out & nothing seems to work!


As fas as I know Applet classes should be placed in the folder where you place all html files, as they should be served to the client when requested. The folder usually is the root folder of your web application.
For example:
in case of Tomcat,
the structure is :

Hope this helps....
Vadiraj
[ May 09, 2003: Message edited by: Vadiraj Deshpande ]
 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is also an html converter tool that makes it possible to view them in browser that dont have current jre's but the class files has to be in a public place due to security applkets cannot access web-inf folders
 
I yam what I yam and that's all that I yam - the great philosopher Popeye. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic