zhoupuyue 发表于 2013-1-28 12:38:35

applet自动检测jre局域网下载安装

如果不能访问外网,把codebase的值http://java.sun.com/update/1.6.0/jinstall-6u14-windows-i586.cab#Version=6,0,0,8替换成本地服务器地址就可以了http://10.70.32.58:8080/iKnow/imageupload/jre-windows-i586.exe,如果客户端没有安装jre,会提示用户安装,安装完后要重新打开浏览器才能使用。jre-windows-i586.exe下载地址:https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewFilteredProducts-SingleVariationTypeFilter,需要先注册、登录。源html文件:<div class="imageuploadform" id="imageuploadcontainer"><applet name="imageuploadapplet" style="width:800px;height:650px;" code="com.xxx.imageupload.ImageFrame" codebase="/iKnow/imageupload" archive="/iKnow/imageupload/imageupload.jar"></applet></div>用jdk自带的HtmlConverter转换后的html文件:#set($userName = "$!{context.getUser()}")#set($docFullName = "$!{doc.getFullName()}")#set($docParentName = "$!{doc.getParent()}")#set($serverIP = "${request.getServerName()}")#set($appPath = "${request.getContextPath()}")#set($serverPort = "${request.getServerPort()}")<div class="imageuploadform" id="imageuploadcontainer"><!--"CONVERTED_APPLET"--><!-- HTML CONVERTER --><!--codebase = "http://$serverIP:$serverPort$appPath/imageupload/jinstall-6u18-windows-i586.cab#Version=6,0,0,7"--><object    classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"    codebase = "http://$serverIP:$serverPort$appPath/imageupload/jre-windows-i586.exe"    NAME = "imageuploadapplet"   WIDTH = "800px"    HEIGHT = "650px">    <PARAM NAME = CODE VALUE = "com.xxx.imageupload.ImageFrame" >    <PARAM NAME = CODEBASE VALUE = "/iKnow/imageupload" >    <PARAM NAME = ARCHIVE VALUE = "/iKnow/imageupload/imageupload.jar" >    <PARAM NAME = NAME VALUE = "imageuploadapplet" >    <param name = "type" value = "application/x-java-applet;version=1.6">    <param name = "scriptable" value = "false">    <param name = "username" value="$userName">    <param name="docfullname" value="$docFullName">    <param name="password" value="123456">    <param name="docparentname" value="$docParentName">    <param name="rpcurl" value="http://$serverIP:$serverPort$appPath/xmlrpc">    <comment><embed            type = "application/x-java-applet;version=1.6" \            CODE = "com.xxx.imageupload.ImageFrame" \            JAVA_CODEBASE = "/iKnow/imageupload" \    WIDTH = "800px" \    HEIGHT = "650px" \            ARCHIVE = "/iKnow/imageupload/imageupload.jar" \            NAME = "imageuploadapplet" \    scriptable = false \    pluginspage = "http://java.sun.com/products/plugin/index.html#download" \    username = "$userName" \    password = "123456" \    docfullname = "$docFullName" \    docparentname = "$docParentName" \    rpcurl = "http://$serverIP:$serverPort$appPath/xmlrpc" >    <noembed>                        </noembed></embed>    </comment></object><!--<APPLET CODE = "com.xxx.imageupload.ImageFrame" JAVA_CODEBASE = "/iKnow/imageupload" ARCHIVE = "/iKnow/imageupload/imageupload.jar" NAME = "imageuploadapplet"></APPLET>--><!--"END_CONVERTED_APPLET"--></div>
页: [1]
查看完整版本: applet自动检测jre局域网下载安装