I try to let servlet println to client a http file which contains a Swing applet
(HelloSwingApplet from Java Tutorial). Browser can not initiate the applet after
it loads plug-in. But if I save the source code of the servlet's print out as
a HTML file, I can browse the file!
Any one meet this problem before? Follwing is the code.
out.println("<SCRIPT LANGUAGE=JavaScript><!--");
out.println("var _info = navigator.userAgent; var _ns = false;");
out.println("var _ie = (_info.indexOf(\"MSIE\") > 0 && _info.indexOf(\"Win\") >
0 && _info.indexOf(\"Windows 3.1\") < 0);");
out.println("if (_ie == true) document.writeln('<OBJECT
classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\" WIDTH =500 HEIGHT =200
codebase=\"http://java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab
#Version=1,1,2,0\"><NOEMBED><XMP>');");
out.println(" else if (_ns == true) document.writeln('<EMBED
type=\"application/x-java-applet;version=1.1.2\"java_CODE = \"HelloSwingApplet.class\"
WIDTH =500 HEIGHT=200
pluginspage=\"http://java.sun.com/products/plugin/1.1.2/plugin-install.html\">
<NOEMBED><XMP>');");
out.println("//--></SCRIPT>");
out.println("<APPLET CODE = \"HelloSwingApplet.class\"
CODEBASE=\"http://xx.xx.xx.xx:8080/\" WIDTH = 570 HEIGHT = 500 ></XMP>");
out.println("<PARAM NAME=\"type\"
VALUE=\"application/x-java-applet;version=1.1.2\">");
out.println("</APPLET>");
out.println("</BODY>");
out.println("</HTML>");
Thanks!
Fan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html