pplet虽然已经基本上没人用了但是它还有一些应用场景的为了兼容性为了各个浏览器不能直接直接写<applet>标签最后考虑一下测试了几天最后还是写如下比较适合多个浏览器兼容希望对大家有所帮助
<%@page language="java" import="javautil*" pageEncoding="UTF"contentType="text/html; charset=utf"%><%//该写法兼容FirefoxIEChrome浏览器//applet加载类String appletClass = "cncompanskyframecqapprinterCQAPPrinterAppletclass";//依赖jar包目录String appletCodebase="applets";String appletJar = "commonsloggingjarcommonscollectionsjarjfreechartjarjcommonjar";int width = height = ;//查询参数String queryString = requestgetQueryString();if (queryString == null) {queryString = "";}queryString = "/otp/cqap/cqapprinterservletjsp?" + queryString;%><!DOCTYPE html PUBLIC "//WC//DTD XHTML Transitional//EN" "<html><head><meta httpequiv="XUACompatible" content="IE=EmulateIE" /><meta httpequiv="ContentType" content="text/html; charset=utf" /><title>打印</title></head><body><! 环境判断 ><!"CONVERTED_APPLET"><! CONVERTER VERSION ><SCRIPT LANGUAGE="JavaScript"><! var _info = navigatoruserAgent; var _ns = false; var _ie = (_infoindexOf("MSIE") > && _infoindexOf("Win") > && _infoindexOf("Windows ") < );//></SCRIPT><COMMENT><SCRIPT LANGUAGE="JavaScript"><! var _ns = (navigatorappNameindexOf("Netscape") >= && ((_infoindexOf("Win") > && _infoindexOf("Win") < && javalangSystemgetProperty("osversion")indexOf("") < ) || (_infoindexOf("Sun") > ) || (_infoindexOf("Linux") > )));//></SCRIPT></COMMENT><! applet展示 ><%<applet width= height=> <PARAM NAME=CODE VALUE="<%=appletClass%>"><PARAM NAME=CODEBASE VALUE="applets"><PARAM NAME=ARCHIVE VALUE="<%=appletJar%>"> <PARAM NAME="type" VALUE="application/xjavaapplet;version="> <PARAM NAME="scriptable" VALUE="false"> <PARAM NAME="REPORT_URL" VALUE ="<%=queryString%>"></applet>%><OBJECT classid="clsid:ADCEDBEFD"type="application/xjavabean;version="codebase="#Version="WIDTH="<%=width%>" HEIGHT="<%=height%>"><PARAM NAME=CODEBASE VALUE="<%=appletCodebase %>"><PARAM NAME=ARCHIVE VALUE="<%=appletJar%>"><PARAM NAME=CODE VALUE="<%=appletClass%>"><PARAM NAME="scriptable" VALUE="false"><PARAM NAME="REPORT_URL" VALUE="<%=queryString%>"><comment><EMBED type="application/xjavabean;version="pluginspage="CODE="<%=appletClass%>" CODEBASE="<%=appletCodebase %>"ARCHIVE="<%=appletJar %>"WIDTH="<%=width%>" HEIGHT="<%=height%>"REPORT_URL="<%=queryString%>" scriptable=false><noembed></noembed></EMBED></comment></OBJECT></body></html>