Win a copy of Spark in Action this week in the Open Source Projects 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 tag in a servlet.

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am developing a plugin for JIRA. When I deploy this plugin, I copy the plugin jar to the lib folder of JIRA. In the jar, I have classes HelloWorldServlet and HelloWorldApplet present in the same package. When a request come to the servlet, I put the following html code in the PrintWriter object of the servlet.

out.println("<applet code=\"com.plugin.HelloWorldApplet.class\" width=\"100\" height=\"140\"></applet>");
out.close();


On the browser, it shows 'Failed to load the applet' and in the console I get error message 'Unable to find the file'. Say the JIRA server is on one machine, X and I am accessing it from another machine, say Y.

Is there something that I am doing wrong ?

Thanks
Devang Shah
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applets can not use classes that are inside the WEB-INF directory, because the server won't send those to the browser. You'll need to put the jar file containing the applet classes in a publicly accessible directory. Have a look at the CODEBASE and ARCHIVE attributes of the APPLET tag for how to specify where that directory is.
 
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic