JBoss-IDE 1.2.2 Tutorial 5

zhaozj2021-02-16  52

JBOSS-IDE 1.2.2 Tutorial 5:

Now we have to add an HTML file to bring some parameters into the servlet. Add a 'Docroot' data clip. Add an empty 'index.html' file. 'Index.html' is the preset file of the web app. An Form will take the parameters to the servlet.

The detailed code of 'index.html' is as follows:

</p> <p>FIBONACCI Application</p> <p></ title></p> <p></ hEAD></p> <p><body></p> <p><H1> Fibonacci Form </ h1></p> <p><form action = "compute" method = "post"></p> <p><Table cellspacing = "2" cellpadding = "2" border = "0"></p> <p><tr></p> <p><TD></p> <p>Limit:</p> <p></ td></p> <p><TD></p> <p><Input Type = "text" name = "limited" value = "50"></p> <p></ td></p> <p></ TR></p> <p><tr></p> <p><TD></p> <p><Input Type = "Submit" name = "compute" value = "compute"></p> <p></ td></p> <p><TD></p> <p><Input Type = "RESET"></p> <p></ td></p> <p></ TR></p> <p></ TABLE></p> <p></ form></p> <p></ body></p> <p></ html></p> <p>J2EE application project:</p> <p>To complete the J2EE project, we have to add some additional files. In 'application.xml' profile, this file is a configuration document for the J2EE project, refers to EJB packets and WAR Pack of the package.</p> <p>The detailed code of 'Application.xml' is as follows:</p> <p><? XML Version = "1.0" encoding = "UTF-8"?></p> <p><! Doctype application public "- // Sun microsystems, Inc.//dtd j2ee application 1.3 // en" "http://java.sun.com/dtd/application_1_3.dtd"></p> <p><Application></p> <p><Display-Name> Sum Application </ display-name></p> <p><module></p> <p><EJB> FIBOEJB.JAR </ EJB></p> <p></ module></p> <p><module></p> <p><web></p> <p><Web-Uri> Fiboweb.war </ web-uri></p> <p><context-root> / FIBO </ context-root></p> <p></ web></p> <p></ module></p> <p></ application></p> <p>Package:</p> <p>JBoss-IDE has a very convenient package setting, and is not limited. In the tutorial, the package setting will be set:</p> <p>l An EJB JAR file. This file has EJB class, interface, and deployment files.</p> <p>l A JAR file of an EJB client. Interface with EJB.</p> <p>l A WAR file for a web app. There is a servlet, an EJB client's JAR and deployment profile.</p> <p>l A JAR file for a J2EE project. There is an EJB JAR, Web App War, and deployment files.</p> <p>When started, these four package settings generate J2EE project deployments.</p> <p>Right-click the item to select 'Properties' ->' packaging configurations'. Tap 'add archive' in the right hand side window. Enter 'fiboejb.jar' and press' OK '. Now add a package settings generate' FIBOEJB. Jar 'file.</p> <p>Now we have to add EJB classes and interfaces in 'fiboejb.jar', and those files in the 'src / bin' data clip (such as the output of the preset project). First choose 'FIBOEJB. Jar' Select 'add folder' in the right hand. In the pop-up window, you can choose a built-in or external folder, including or excluded files, pre-word, etc. Select 'Project Folder' -> '/ Tutorial / Bin '->' ok '. Included Fill in' Tutorial / EJB / *. Class, Tutorial / Interfaces / *. Class' -> 'OK'.</p> <p>We want to deploy documents in 'Fiboejb.jar' Riga, choose 'FIBOEJB. Jar' to choose 'add file' in the right hand on the right. You can choose a built-in or external file in the pop-up window. Words and other settings. Choose 'Project File' -> '/Tutorial/Src/meta-inf/ejb-jar.xml' -> 'OK'. Prefix fills in 'meta-inf' -> 'OK '.</p> <p>The above movement, this time the file is selected 'jboss.xml', the other, the package 'fiboejb.jar' is completed, as shown below:</p> <p>Follow us to add an EJB client package setting. Datong, right-click on the right hand side window selection 'add archive'. Enter 'fiboejb-client.jar' to choose 'OK', then click 'Fiboejb-Client.jar' Add Folder 'Press' / Tutorial / Bin' in 'Project Folder', in 'Includes' Enter' Tutorial / Interfaces / *. Class' -> 'OK'. EJB Client's package has been completed:</p> <p>Follow us to add a WAR package setting for Web App. Datong, right click on the right hand side window selection 'add archive'. Enter 'fiboweb.war' to choose 'OK', then click 'Fiboweb.war' Choose 'Add FiboWar' Press 'Project Folder' to select '/ tutorial / bin', in 'include' input 'tutorial / web / *. Class', 'prefix' input 'web-inf / class' -> 'ok'. Together with basic WAR configuration document, we have to choose 'fiboweb.war', right click on 'add file', select '/Tutorial/Src/web-inf/web.xml', and 'prefix' input 'web-inf'. Add another basic configuration document, select 'Fiboweb.war', right click on 'add file' to choose 'Porject File' select '/Tutorial/Src/web-inf/jboss-web.xml'. Plus EJB client JAR, choose 'Fiboweb.war', click on 'add file', select '/Tutorial/fiboejb-client.jar', although there is no 'fiboejb-client.jar' file, but can still add settings, And 'prefix' is to fill in 'Web-INF / LIB' -> 'OK'. Then the HTML file, select 'FIBOWEB.WAR', right to select 'add folder' selection '/ tutorial / doch', this is The content of the web app. The WAR package has been completed: to the EAR setting, the same, right pick the 'add archive', enter 'fiboApp.ear' and press 'OK'. Choose 'FIBOAPPP.EAR' right 'Add file' input '/Tutorial/src/meta-inf/application.xml', because this file is in 'meta-inf', so 'prefix' is filled in 'Meta-Inf' Press 'OK' To add an EJB module, select 'FIBOAPP.EAR' Right to select 'Add file' to fill in '/Tutorial/fiboejb.jar'. Although this archive is now Does not exist, but we can still join, press 'OK'. To add a web module, select 'FiboApp.ear' right picking 'add file' fill in '/Tutorial/fiBoweb.war'. Although this file is now Presented, but we can still join, press 'OK'. This EAR package has been completed:</p> <p>After saving the information by 'ok', you will see a new file 'packaging-build.xml' in the project, which contains a complete J2EE project package setting.</p> <p>You can now run the package, right-click the item to select 'Run Packaging', the console will display the following message, and there will be more JAR in the project, a WAR and an EAR profile:</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-21977.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="21977" 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.045</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 = 'PKVwPOiKe4QrxrMqaBPhNFXZQ5Kky_2BWXWZwckUdS77BuI5bGTDICSz8Ytdg1aeuYNjElV4tA1hLMtPLBifqA_2FA_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>