Java Web Start Realization Key

zhaozj2021-02-16  49

Implementing Java Web Start may need to pay attention to the following questions:

1. JAVA Web Start has been brought by JDK1.4, but it also needs to be manually founded to find JDK1.4

The Javaws *** installation file is running in the record will install Java Web Start.

D: / program files / java web start directory, pay attention to run Java online

The program will be downloaded to the directory after the program of Web Start. Javaws / Cache directory.

2. Be aware of the configuring web sever, such as JRUN, you need to configure Web Application -> Demo -> Mime Type Mapping, where you want to add new MIME types:

JNLP: Application / X-java-jnlp-file

JAR: Application / X-java-jnlp-file

Other Web Sever, such as Tomcat, may have to modify the web.xml file manually, add as follows:

Application / X-java-jnlp-file

If you do not perform the above configuration, you run the * .jnlp file directly in the browser directly, only the text in * .jnlp, in fact, the above process is equivalent to the association with the .jnlp suffix, make sure you can return in your browser. The correct MIME type.

3. Format of JNLP file

====================================

'Specify the J2SE version 1.0,' UTF-8 'is the encoding format, this code is generally not required.

'Specify the main directory of the Server side

'Setting some information, including: Title, Provider, Description, Home, etc. myie </ title> <vendor> Rookiesoft Corporation </ vendor> <Description> Myie Just Demo How To Program with JNLP. </ Description> < Homepage href = "http: // localhost: 8100 / demo / javawebstart" /> <icon href = "./../iMages / rookie.gif" /> <icon kind = "Splash" href = ". / .. /> <offline-allowed /> </ information></p> <p>'Sometimes you need to set a safety rule, such as all-permission means allowing all operations, including local file access, etc., this is not required. <Resources></p> <p>'Specify J2SE version</p> <p><J2se Version = "1.3 " /></p> <p>'Specify that you want to download to the local JAR file (note that all files need to be packaged to download)</p> <p><jar href = "myie.jar" /></p> <p></ resources></p> <p>'Specify the main class at runtime</p> <p><Application-Desc Main-Class = "Myie" /></p> <p>'You can specify the parameters run, you can have multiple parameters, you can write in parallel. <Argument> arg1 </ argument> </ application-desc> </ jnlp></p> <p>====================================</p> <p>** Download Resource Error</p> <p>The "Download Resource Error" may appear when using Java Web Start, and the approximate error message is as follows:</p> <p>*********************************************************** *****</p> <p>JNLPEXCEPTION [CATEGORY: Download Error: Exception: Java.io.IOException: Rename Failed in Cache: LaunchDesc: null] AT .....</p> <p>*********************************************************** *****</p> <p>This error is because every time you call Java Web Start, you will find the program to update the program and download the program to the cache directory under the local Java Web Start directory, if Cache</p> <p>There is already the same name file, and the file is being used, then the newly downloaded file will have a rename failed error, and the local manual is deleted.</p> <p>The file will also report: the file is being used! Here, Java</p> <p>The SIGN mechanism in web start may mark each JAR file. Sometimes you see javaw.exe in the task manager, you can delete the local JAR file after termination, indicating This</p> <p>Some local files may still keep the file lock! Sometimes even if all Java programs are killed even if you take the Task Manager</p> <p>Still an error, you must log out of Windows, don't know if it is Java Web Start</p> <p>It's your own problem.</p> <p>** argument</p> <p>If you need to deliver the parameters to the * .jar file, you can use the following code:</p> <p><Application-Desc Main-Class = "Xbframe" /></p> <p><argument> -port </ argument></p> <p><argument> 1008 </ argument> should pay attention to -port and 1008 are two parameters, to be separated. </ Application-Desc> ** JWS Console</p> <p>Sometimes you need to see the information of the system.out.print statement in * .jar, you can open the JWS console, you can set it in the preferences in JWS Manager.</p> <p>** Security</p> <p>During the Java Web Start, the local file operation, access remote database, etc. are safe to limit, and if you want to implement these operations, it is generally</p> <p>Add code in JNLP:</p> <p><security> <all-permissions /> </ security></p> <p>The above code represents all operations, but to achieve this, you need to perform SIGN operations on the * .jar file, which is a safe signature, which can be used.</p> <p>The KEYTOOL and JARSIGNER tools in JDK are signed, steps are as follows:</p> <p>** KeyTool</p> <p>For example: keytool -genkey -alias myself -keypass 888888</p> <p>'-alias means a pseudonym, to remember this pseudonym, followed by</p> <p>'-Keypass Enter a password.</p> <p>The keystore file is usually generated, and KeyTool has some other options to view help in Console.</p> <p>** jarsigner</p> <p>For example: jarsigner -alias myself ***. JAR</p> <p>Jarsigner represents a visa to the JAR program. You can set the all-permissions properties only if the visa program can set.</p> <p>** Root Certification</p> <p>You can also choose Root certification in the preferences in JWS Manager.</p> <p>** CERTIFICATE</p> <p>The default of the RSA and DSA is used by default in Jarsigner. Some companies also want to buy the Certificate files themselves, but both ways should be running, generally running the Java Web Start program for the first time.</p> <p>The dialog box will pop up to confirm whether the authentication is recognized.</p> <p>** Last description</p> <p>Because it is also a newbie to JWS, there are many problems just awareness. If there is an improper expression or understand the skin, please bear with me.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-27400.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="27400" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.033</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'rYpgmZEFRqsrMYEF7UEzb9MrjxBx7wECcmkEJ6NH_2BRxseQR_2Bj8wXYlFvgl8fOST58rlwr_2B7T_2BSzsjXv2L8wbzw_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>