Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet tag in a servlet.

 
Shah Devang
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
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic