JBUILDER 4 Enterprise Development CORBAWeb Application Instance

zhaozj2021-02-17  41

Example Ideas This instance will create a bank account query program. Create an IDL file, execute the IDL2JAVA compiler, generate the skeleton of the server and the corresponding client's pile, then create a server-side Java program and an HTML client program based on the above-generated framework. Example Development Tools Borland JBuilder 4 Enterprise (1) Select the File | New Project menu, create a new project in JBuilder. (2) Modify Project Name to BankTutorial, modify the root path is C: / Sample, click Finish. (3) Select File | New, select Sample Idl on the Enterprise page. (4) Enter BankTutorial.IDL in the File Name box, click OK, will create an example IDL file. Enter the following code in the IDL file: module bank {interface account (); {float balance ();}; interface accountmanger {account open (in string name);};}; (5) right-click BankTutorial in the Project column. IDL file. Select Make to execute the IDL2JAVA compiler. (6) Create a server-side program: Select File | New, select Corba Server Application from Enterprise Pages. (7) Select C: / Sample / BankTutorial / SCR / BankTutorial / BankTutorial.IDL in the IDL File box. Select Generate Visible Application With Monitor to create a monitor interface for the server program. Click OK. The server program is named BankServerApp.java. (8) In specific project development, the CORBA interface server is implemented, and can be added to the BankTutorial.Bank.Server in the Project column. This example does not add any user code. (9) Create a CORBA's HTML client program, select File | New, select HTML CORBA Client from Enterprise Pages. (10) In the HTML CORBA Client Wizard, IDL file selects the IDL file corresponding to the generated server side, namely: C: / Sample / BankTutorial / SCR / BankTutorial / BankTutorial.IDL. Package Select BankTutorial, click OK, generate HTML CORBA Client related files, which generate a JSP page file. (11) Off the client's program, you can add to the corresponding class of BankTutorial.Bank.clientHTML in the Project column. This example does not add any user code. (12) Translation project, select Project | make Project "BankTutorial.jpx". (13) Start the Smart Agent, select Tools | Visibroker Smart Agent. (14) Start the server program: Right click on the file BankServerApp.java in the Project column, select RUN. The server-side run interface will be displayed on the screen. (15) Run the HTML client program: Right-click FORMBANK.JSP in the Project column, select Web Run. The client run interface will be displayed on the screen.

转载请注明原文地址:https://www.9cbs.com/read-30946.html

New Post(0)