• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Servlet can Call an Applet  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Question is when servlet call and applet like this
out.println("<applet code=xyz.class width=200 height=400></applet>")
this is work?? if yes kindly tell me where the xyz.class should placed or how should i call an applet class in servlet??
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applet code should be placed in the root directory where your main HTML Web Page is located. In Java Web Server this is public_html, inside your JavaWebServer2.0 DIR
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could you elaborate this.
i`ve tried putting the applet class file in the same directory as
i`ve put the compiled servlet(.class) that calls the applet.but the servlet is running well but applet is not called(initialized).
please respond quickly.
[This message has been edited by abj (edited June 28, 2000).]
 
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It isn't loaded because the originating URL is the /servlet/xxxx directory, but the server is forbidden to directly serve files from that directory. The best fix is to specify a BASE tag when writing the page the applet is contained in. This will cause the browser to look in the base directory for applet class files, image files, html files, etc.
<base href="http://url/rootdir/" >
or
<base href="/rootdir/" >
BASE tags go in the <head> </head> area.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi paran

try it this way
use codebase attribute in <applet> tag

like this
in your servlet code write
out.println("<appletcode=xyz.class codebase=http://...... width=300 height=300>");
 
egahari
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by gparan:
My Question is when servlet call and applet like this
out.println("<applet code=xyz.class codebase=http://..... width=200 height=400></applet>")
this is work?? if yes kindly tell me where the xyz.class should placed or how should i call an applet class in servlet??


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!