How to place an applet compatible with Firefox, IE, and Chrome on a JSP

Source: Internet
Author: User

  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

&lt;% @page language= "java" import= "java.util.* pageencoding=" UTF-8 "contenttype=" text/html; Charset=utf-8 "%&gt; &lt;%//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; %&gt; &lt;! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv=" x-ua-compatible content= "Ie=emulateie8"/&gt; &lt;meta http-equ iv= "Content-type" content= "text/html; Charset=utf-8 "/&gt; &lt;title&gt; print &lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;!--environmentJudge--&gt; &lt;!--"Converted_applet"--&gt; &lt;!--CONVERTER VERSION 1.1--&gt; &lt;script language= "JavaScript" &gt;& lt;! --var _info = navigator.useragent;
    var _ns = false; var _ie = (_info.indexof ("MSIE") &gt; 0 &amp;&amp; _info.indexof ("Win") &gt; 0 &amp;&amp; _info.indexof ("Windows 3.1") ;
0); --&gt;&lt;/script&gt; &lt;COMMENT&gt; &lt;script language= "JavaScript1.1" &gt;&lt;!--var _ns = (Navigator.appnam E.indexof ("Netscape") &gt;= 0 &amp;&amp; (_info.indexof ("Win") &gt; 0 &amp;&amp; _info.indexof ("Win16") &lt; 0 &amp;&amp ; Java.lang.System.getProperty ("Os.version"). IndexOf ("3.5") &lt; 0) | | (_info.indexof ("Sun") &gt; 0) | |
(_info.indexof ("Linux") &gt; 0)); --&gt;&lt;/script&gt;&lt;/comment&gt; &lt;!--applet Showcase--&gt; &lt;%--&lt;applet width=460 height=160&gt; &lt;PARA M name=code value= "&lt;%=appletClass%&gt;" &gt; &lt;param name=codebase value= "applets" &gt; &lt;param name=archive V  Alue= "&lt;%=appletJar%&gt;" &gt; &lt;param name= "type" Value= "application/x-java-applet;version=1.2.2" &gt; &lt;param name= "scriptable" value= "false" &gt; &lt;PARAM NAME= "Report_url" VALUE = "&lt;%=queryString%&gt;" &gt; &lt;/applet&gt;--%&gt; &lt;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=" &lt;%=width%&gt; "HEIGHT=" &lt; %=height%&gt; "&gt; &lt;param name=codebase value=" &lt;%=appletcodebase%&gt; "&gt; &lt;param NAME=ARCHIVE VALUE=" &lt; %=appletjar%&gt; "&gt; &lt;param name=code value=" &lt;%=appletClass%&gt; "&gt; &lt;param name=" scriptable "value=" Fals E "&gt; &lt;param name=" report_url "value=" &lt;%=queryString%&gt; "&gt; &lt;comment&gt;&lt;embed type=" application/x- java-bean;version=1.1.2 "pluginspage=" http://java.sun.com/products/plugin/1.1.2/plugin-install.html "code=" &lt;% =appletclass%&gt; "codebase=" &lt;%=appletcodebase%&gt; "archive=" &lt;%=appletjar%&gt; "width=" &lt;%=width%&gt; "height=" &lt;%=height%&gt; "report_url=" &lt;%=queryString%&gt; "Scriptab le=false&gt; &lt;noembed&gt;&lt;/noembed&gt; &lt;/EMBED&gt;&lt;/comment&gt; &lt;/OBJECT&gt; &lt;/body&gt; &lt;/h Tml&gt;
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.