Pplet Although almost no one has used it. But it also has some application scenarios, for compatibility. For each browser, you can not directly write <applet> tags, and finally consider the test for a few days, and finally write the following more suitable for multiple browser compatibility, I hope to help you
<% @page language= "java" import= "java.util.* pageencoding=" UTF-8 "contenttype=" text/html; Charset=utf-8 "%> <%//This is compatible with Firefox, IE, Chrome browser//applet load class String Appletclass ="
Cn.com.pansky.frame.cqap.printer.CQAPPrinterApplet.class ";
relies on jar package directory String appletcodebase= "applets"; String Appletjar = "Commons-logging-1.1.1.jar,commons-collections-2.1.1.jar,jfreechart-1.0.12.jar,
Jcommon-1.0.15.jar ";
int width = +, height = 200;
Query parameter String querystring = Request.getquerystring ();
if (querystring = = null) {querystring = "";
} querystring = "/otp/cqap/cqap-printer.servlet.jsp?" + querystring; %> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html> <head> <meta http-equiv=" x-ua-compatible content= "Ie=emulateie8"/> <meta http-equ iv= "Content-type" content= "text/html; Charset=utf-8 "/> <title> print </title> </head> <body> <!--environmentJudge--> <!--"Converted_applet"--> <!--CONVERTER VERSION 1.1--> <script language= "JavaScript" >& lt;! --var _info = navigator.useragent;
var _ns = false; var _ie = (_info.indexof ("MSIE") > 0 && _info.indexof ("Win") > 0 && _info.indexof ("Windows 3.1") ;
0); --></script> <COMMENT> <script language= "JavaScript1.1" ><!--var _ns = (Navigator.appnam E.indexof ("Netscape") >= 0 && (_info.indexof ("Win") > 0 && _info.indexof ("Win16") < 0 && ; Java.lang.System.getProperty ("Os.version"). IndexOf ("3.5") < 0) | | (_info.indexof ("Sun") > 0) | |
(_info.indexof ("Linux") > 0)); --></script></comment> <!--applet Showcase--> <%--<applet width=460 height=160> <PARA M name=code value= "<%=appletClass%>" > <param name=codebase value= "applets" > <param name=archive V Alue= "<%=appletJar%>" > <param name= "type" Value= "application/x-java-applet;version=1.2.2" > <param name= "scriptable" value= "false" > <PARAM NAME= "Report_url" VALUE = "<%=queryString%>" > </applet>--%> <object classid= "clsid : 8ad9c840-044e-11d1-b3e9-00805f499d93 "type=" application/x-java-bean;version=1.1.2 "codebase=" http:// java.sun.com/products/plugin/1.1.2/jinstall-112-win32.cab#version=1,1,2,0 "width=" <%=width%> "HEIGHT=" < %=height%> "> <param name=codebase value=" <%=appletcodebase%> "> <param NAME=ARCHIVE VALUE=" < %=appletjar%> "> <param name=code value=" <%=appletClass%> "> <param name=" scriptable "value=" Fals E "> <param name=" report_url "value=" <%=queryString%> "> <comment><embed type=" application/x- java-bean;version=1.1.2 "pluginspage=" http://java.sun.com/products/plugin/1.1.2/plugin-install.html "code=" <% =appletclass%> "codebase=" <%=appletcodebase%> "archive=" <%=appletjar%> "width=" <%=width%> "height=" <%=height%> "report_url=" <%=queryString%> "Scriptab le=false> <noembed></noembed> </EMBED></comment> </OBJECT> </body> </h Tml>