This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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
 
Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic