Getting started with Beehive

xiaoxiao2021-04-09  359

Author: Xiao Jing

1 Introduction to Beehive 1. What is Beehive? BEA extracts part of the WebLogic Server runtime framework, submitted to Apache after modification, forming today's Beehive. Beehive reflects several features that BEA added to WebLogic8.1: JPF (Java Page Flow), Simplified Resource Access Method - Control, Simplified Web Service Development, which makes J2EE more simpler; more important Yes, Beehive is no longer relying on the WebLogic Server environment, but can run in the vast majority of the containers that support servlet / JSP 2.3, which allows J2EE's application developers to provide BEEHIVE, at the same time can be between J2EE platforms Seamless transplantation. 1.2 Beehive Composition Beehive includes three parts, namely: Page Flow, Controls, and Web services.

1. Page Flow's MVC framework based on Struts, using JSR-175 to solve the automatic update of the Struts profile, which makes Struts development easier to implement the IDE tool, and provides some more easy to use features:

Status Management All Pages and Processing Actions in JPF are viewed as a session, and the variables declared in JPF can be accessed in each page, including JavaBean. [Note] When the user leaves the page stream, the data stored in the session state will be automatically released to use session data more efficiently. Therefore, multiple JPFs are unable to share session data. A set of label libraries in the rich data binding feature Page Flow provides binding between data and JSP pages to make the display interface programming easier. Concentrated exception handling can handle exceptions in a JPF or across a set of page flows in Globel.App. Obviously, we can easily handle an abnormality for the entire application set, allowing the program more flexible - such as common login timeout information, permission information, etc., you should judge every page, now You can judge at the entrance.

2. Controls Create a framework for lightweight J2EE components, you don't have to write a lot of code to do the following frequently:

It is used to create components that access resources such as databases, local files, web services. Business logic for packaging companies can be reused.

3. An implementation of Web Services JSR-181 supports web service development methods based on Javadoc annotation. 2 Start the work of the author's operating system is Windows2000. All the steps below are also for Windows2000. If you use other operating systems, you need to do some corresponding adjustments according to the following steps. If you need help, please via email: guilaida@163.com Contact the author. 2.1 Tool Download 1. Servlet Container - Tomcat5.5.8 In order to demonstrate the portability of Beehive, the servlet does not select WebLogic Server, but the other open source project of Apache is selected - Tomcat5.5.8, the following example is mainly Tomcat5. 5.8 Take the example, if you use other servlet containers or other versions of Tomcat, follow your environment to adjust. Tomcat download site: http://jakarta.apache.org/site/binindex.cgi

2. JDK1.5.x Because Tomcat5.x is developed based on JDK1.5.x, if you use JDK, you need to do some changes, so you can download 1.5 or above version of JDK, I The JDK version number is 1.5.0_01.3. The latest version of Beehive Beehive is 1.0, you can go to http://incubator.apache.org/beehive to download the installation package.

4. Ant Beehive Environment Preparation, the program compiles to use Ant as the build tool, so please download the latest version of Ant, the authors are 1.6 [Note] This should be thanked with BEA, they It greatly reduces the complexity of this work. 2.2 Software Installation 1. After installing JDK will use% java_home% to reference the JDK installation directory, such as the author installed in C: / JDK150, then% java_home% means C: / JDK150 this directory.

2. Install Tomcat to decompress the downloaded Tomcat compression package to a directory such as C: /TOMCAT5.5.8, which will use% tomcat_home by% tomcat_home by%.

3. Unzip Beehive to decompress the downloaded BeeHive compressed package to a directory such as C: /Beehive 1.0, will use% Beehive_Home% to represent this directory.

4. Installing ANT to decompress the downloaded ANT compression package to a directory such as C: / Ant1.6, will use% ant_home% to represent this directory. 2.3 Let Beehive's examples running in Beehive includes three aspects: Page Flow, Controls and Web Services. 8 examples have been taken in the Beehive Download Pack, which demonstrates a variety of different situations, which are located in the% Beehive_Home% / Samples directory. We first select three simple examples - NetUI-Blank, Controls-Blank, WSM-Blank, representing these three directions, now we start working, let these examples ran first. 2.3.1 Environmental Settings 1. Modify% Beehive_Home% / BeeHiveUser.cmd Sets the variables such as BeeHive_Home, Java_Home, Ant_home, CataLina_Home, and each corresponding installation directory. Here is the author's BeehiveUser.cmd file: @echo offrem Customize this file based on where you install various 3rd party componentsrem Such as the jdk, antid and tomcat.rem

Rem the root of beehive distributionset beehive_home = c: /beehive1.0

Rem location of a jdkset java_home = c: / jdk150

Rem location of antset ant_home = Ant1.6

Rem location of tomcatset catalina_home = c: /tomcat5.5.8

SET PATH =% PATH%;% java_home% / bin;% ant_home% / bin

2. Modify Tomcat Permissions Set to make Tomcat to be deployed in real time, you need to modify Tomcat's permissions settings, mainly to modify the% Tomcat_Home% / conf / tomcat-users.xml file, add a Manager role, add a user who belongs to Manager, The author is to expand the permission of Tomcat users to the Manager role. The following is the modified tomcat-users.xml: About Tomcat permission settings, more information Please refer to Tomcat's help documentation. 2.3.2 Let's go up the example of PageFlow 1. Open a DOS window, enter the% beehive_home% directory 2. Execute BeeHiveUser.cmd, set the relevant environment variable 3. Prepare the JAR file and tag declaration file (.tld) ​​necessary for JPF run. Perform ant -f Ant / WebappRuntime.xml -dwebapp.dir =% Beehive_Home% / Samples / Netui-Blank Deploy.beehive.Webapp.Runtime [Note] Webapp.dir is your JPF application directory, must be a full path, no Support relative path 4. Compiling JPF applications Perform ANT -F% Beehive_Home% / Ant / BuildWebapp.xml -dwebapp.dir =% Beehive_Home% / Samples / Netui-Blank Build.WebApp If the compilation is successful, you can start the following steps. If the compilation is not successful, you need to check steps 1 ~ 4. 5. Start Tomcat 6. Open a browser Enter: http: // localhost: 8080 / manager / deploy? Path = / pageflow & war = file: c: /beehive1.0/samples/netui-blank&update=true, if The release is successful, and the OK-Deployed Application at Context Path / PageFlow should be output in the browser. [Note]

PATH = / PAGEFlow is the context path used by your web app C: /beehive1.0/sample/netui-blenk Please replace the absolute path to the NetUi_blank example in your Beehive

7. Test the http: // localhost: 8080 / pageflow in the browser if the following information indicates that your Page Flow is already running: New Web Application Page. 2.3.3 Let the Control example run the steps in steps 1 to 2 and 2.3.2 in the previous steps, followed by the steps to change as follows: 3. Prepare the Control Run-related JAR file and tag declaration file (.TLD) performing ant -f ant / webappRuntimeCore.xml -Dwebapp.dir =% Beehive_home% / samples / controls-blank deploy.beehive.webapp.runtime 4. compile the control performed ant -f% Beehive_Home% / samples / controls-blank / build. XML build command compiles controls in the Controls-Blank project. The controls in the example is simple, only one method hello, the role is to return "Hello!" 5. Deploy the control to the Controls-Blank environment: copy% Beehive_Home% / Samples / Controls-Blank / Build / MyControls. JAR% Beehive_Home% / Samples / Controls-Blank / WEB-INF / LIB, release the JAR file generated in step 5 to the lib directory of the Controls-Blank application.

6. Start Tomcat 7. Create a JSP file to create a helloworld.jsp file in the% Beehive_Home% / Samples / Controls-Blank directory, the contents are as follows: <% @ page language = "java" contenttype = "text / html; charSet = GB2312 "%> <% @ Taglib URI =" http://beehive.apache.org/netui/tags-database.0 "prefix =" Netui-data "%> <% @ Taglib URI =" http: // Beehive.apache.org/netui/tags-html-1.0 "prefix =" Netui "%> <% @ taglib URI =" http://beehive.apache.org/netui/tags-template-1.0 "prefix =" NetUI -Template "%> Control Demo instance </ title> <netui: base /> </ head> <netui: body> <jsp: usebean class =" pkg.hellobean "ID = "Hellobean" Scope = "session" /> <h3> Control Demo Instance - Test Page </ h3> <p> Call Demonstration The return of the Hello method with Control is: <strong> <% = hellobean.hello )%> </ strong> </ p> </ netui: body> </ netui: html> 8. Publishing the web application application context setting to control, the corresponding in the browser inputs as follows: http: // Localhost: 8080 / manager / deploy? path = / control & war = file: c: /beehive1.0/sample=true 9. Test In the browser input: http: // localhost: 8080 / control / helloworld .jsp, if the environment is successfully configured, the return information in the browser should be shown below: 2.3.4 Let the example of the web service run the steps in steps 1 ~ 2 and 2.3.2 in front of the previous steps, followed by steps Change is as follows: 3. Prepare WE B Service Run Master JAR File and Tag Declaration File (.TLD) Perform Ant -f Ant / WebApp.dir =% Beehive_Home% / Samples / WSM-Blank Deploy.wsm.Webapp.Runtime 4. Compile Demo The web service is used to perform ANT -F% Beehive_Home% / Ant / BuildWebapp.xml -dwebapp.dir =% Beehive_Home% / Samples / WSM-BLANK Build.Webapp command Compile Web services in the WSM-Blank project. The web service in the example is relatively simple, and only a method of method SayHelloWorld without parameters is released, returns "Hello World!".</p> <p>5. Start Tomcat 6. Publishing the Web Application Application Context Set to WSM, the corresponding address is entered in the browser: http: // localhost: 8080 / manager / deploy? Path = / control & war = file: c: / beehive1 .0 / samples / wsm-blank & update = true 7. Test In the browser input: http: // localhost: 8080 / wsm / if the environment is successful, the return information in the browser should be shown below: Access Connect "Sayhelloworld", you can see the SOAP return message after accessing the web service:</p> <p>3 Summary This article is concentrated in three aspects: Beehive Project Introduction, the project is required to run the software and environmental preparations and the steps that make the Beehive run on the Tomcat platform and related use commands. Through this paper, you should creating the required Web development environment according to the needs of different applications, and can be skilled, and deploy their web applications. The next article will be "page flow entry door", the author will simply analyze the operation mechanism of the page stream (JPF) frame, and how to apply the label development user interface under the page stream framework through specific examples, implement the page navigation, Processing the basic functions of form submission.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-133101.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="133101" 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.041</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 = 's49jwRnRSH_2F3JmRlQuy9_2BMmjeKhF3CyPQzl5RHARxU9sn0LxkjW0ObVNM_2FpGsEy0FxkkrHJDq_2F6ldRY4tr11VQ_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>