Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet notinted error when imbedded in servlet html output

 
DC Dalton
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...
 
Vadiraj Deshpande
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 ]
 
Nicholas Turner
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic