Getting started with JDeveloper

xiaoxiao2021-03-06  72

JBuilder may be the most popular Java development tool, but it is not free. It will automatically send information to Borland in the latest version of JBuilder9, which is easy to be used to use pirated . Struts is now the most popular Web system architecture, and JBuilder9 comes with Struts 1.0. Of course, I personally still like Borland's products, but because of variety of reasons, the company has changed from Oracle's JDeveloper. JDeveloper1.0 is Oracle, bought JBuilder code from Borland, and heard very little. However, starting from JDeveloper 3.0, JDeveloper starts integrating Oracle's BC4J development component (this is a very powerful, easy-to-use development component), and JDevelPoer has begun to receive attention. Below, I will introduce how to develop the Struts system on the JDeveloper903. First Preparation 1.1 Download JDeveloper First, download the latest version of JDeveloper9.03.3 from Oracle's website, JDeveloper is now free. 1.2 About OC4J also comes with an application server OC4J with Oracle in JDeveloper. Unzip the downloaded compressed package, the J2EE folder under the JDeveloper directory is the directory where OC4J is located. If you want to start OC4J manually, we can perform Java? Cjar Oc4j.jar in its directory. OC4J usage and features are not described in detail here. Second Development Struts System 2.1 Running JDeveloper in the Directory in JDeveloper in JDeveloper is the running program in JDeveloper in Windows. Run the JDeveloper interface as shown below: Figure 1 JDeveloper Struts Development Supports Struts's latest version Struts1.1, and provides the Struts Development Wizard. Below, we will show how to develop the Struts system with JDeveloper. 2.2 Building a Struts System Environment 1) First, we have to create a working space (Workspace). There is a root workspace in JDeveloper, right-click on the root workspace, select "New Workspace ..." to create a new workspace in the pop-up menu. 2) Create an empty project called StrustDemo via FILE | New ... | General | Empty Project. 3) Complete the creation of the Struts development environment through the Struts System Wizard in new work. In the File | New menu, select Struts under the branched Web-Tier, select "Starter Application" in the option on the right, click the "OK" button. Figure 2 has completed the above steps, and a Struts development environment is completed. From JDeveloper we can see the wizard adds web.xml, struts-config.xml, and a proterties file to our project. 2.3 Development Example of a Struts This is just a simple instance, the user enters the URL, will pop up a JSP page, enter user information in the JSP page and submit, will display a list of information on the same page. 2.3.1 Editing Struts-Config.xml file First, we add ActionMApping in Struts-Config.xml, which is used to receive the DynaActionForm that receives user input information in JSP. Right-click Struts-Config.xml, select the Edit Struts Config ... item in the pop-up menu, and the editor of the struts-config.xml file will pop up.

Figure 3 can be seen from Figure 3, JDevelPoer provides us with tools for configuring struts-config.xml files. 1) First select the Form Beans branch to add an ActionForm Figure 42) First select the action mapping branch, then add two actionmapping, set the following Figure 6 Figure 6 We can see from Figure 3, and you can edit Exception through this editor. New features of Struts1.1 such as Plugs. 2.3.2 Editing JSP Select the JavaServer Page (JSP) under the File | New menu, select JSP Page in the option to the right, create a JSP called TestdyNAForm. A tool to write Struts Tag is available in JDeveloper, which can be opened in View | Component Palette. Figure 7 Just select the flag to be edited and then drag it into the JSP file and completes a logo.

Here is the code of TestdyNaForm.jsp: <% @ page language = "java"%> <% @ Taglib URI = "/ Web-inf / struts-bean.tld" prefix = "bean"%> <% @ Taglib URI = "/Web-inf/struts-html.tld" prefix = "HTML"%> <% @ Taglib URI = "/ Web-inf / struts-logic.tld" prefix = "logic"%> < Head> Test Dynamics Form </ Title> <html: Base /> </ head> <body bgcolor = "white> <html: form action =" testdyNaform "> <Table Border =" 0 "width =" 100%> <Tr> <TH Align = "Left"> User Name </ TH> <TD align = "left"> <html: text protety = "username" size = "30" maxlength = "30" /> </ td> </ tr> <TR> <TH Align = "Left"> Gender </ TH> <TD align = "left"> <html: text proteth = "SIZE =" 60 "maxlength =" 60 "/> </ Td> </ tr> <logic: present name =" result "scope =" request "> <logic: item Id =" item "name =" result "type =" mypackage1.user "> <TR > <TD> <bean: Write Name = "item" property = "username" /> </ td> <td> <bean: write name = "item" property = "sex" /> </ td> </ TR > </ Logic: item> </ logic: present> <trspan = "1"> <td> <html: Submi T proteth = "submit" οnclick = "bcancel = false;"</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-109293.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="109293" 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.072</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 = 'XkQe_2FIwf2cNqHshKZrtAGUpMXmvaA_2FRPP_2Fx4gbNKba6bxAsus2BXc0bANMZ84Zql49CMN7rgdOhwTXgdX2S20w_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>