How to embed an applet in cougaar
Ajay Chitturi
achitturi at cougaarsoftware.com
Wed Nov 29 11:15:12 EST 2006
Hello all
My goal is to have users the ability to browse directories and multiple
files, in order to upload them to webtomcat running inside cougaar.
My approach was to use source forge, jupload
(http://sourceforge.net/projects/jupload/)
But that uses an applet.
I struggled to get embed an applet inside cougaar, here is my approach
(following code is inside a servlet , doGet method)
out.println("<html>");
out.println("<applet CODE=\"wjhk.jupload2.JUploadApplet.class\" "
+ "ARCHIVE=\"$"
+
getNodeIdentificationService().getMessageAddress().getAddress()
+ "/fileServer?name=\"wjhk.jupload.jar\" "
+ "WIDTH=\"640\" HEIGHT=\"300\">");
out
.println("<PARAM NAME = CODE VALUE =
\"wjhk.jupload2.JUploadApplet\" >");
out.println("<PARAM NAME = ARCHIVE VALUE = \"$"
+
getNodeIdentificationService().getMessageAddress().getAddress()
+ "/fileServer?name=wjhk.jupload.jar\" >");
out.println("<PARAM NAME=\"type\" "
+ "VALUE=\"application/x-java-applet;version=1.4\">");
out.println("<PARAM NAME=\"scriptable\" VALUE=\"false\">");
out.println("<PARAM NAME = \"postURL\" VALUE "
+
"=\"/multiFileSelectServlet?URLParam=URL+Parameter+Value\">");
out.println("<PARAM NAME = \"nbFilesPerRequest\" VALUE =\"2\">");
out.println("</applet>");
out.println("</html>");
I tried to give the jar file as a URI in "ARCHIVE" as well
I placed the "wjhk.jupload.jar" in $CIP/sys,
$CIP/webtomcat/data/webapps, $CIP/webtomcat/data/webapps/ROOT and is
available to the configfinder as well.
All my attempts to embed the applet seem to be futile
Finally I end up with a classnotfound exception
java.lang.ClassNotFoundException: wjhk.jupload2.JUploadApplet
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native
Method)
... 10 more
Please help me in embedding an applet within cougaar's tomcat.
Thanks in advance
Ajay Chitturi
Software Engineer
Cougaar Software, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cougaar.org/pipermail/cougaar-developers/attachments/20061129/23420b74/attachment-0001.html
More information about the Cougaar-developers
mailing list