Distributed application development is a feature of JBuilder Enterprise.
HTML client applications are HTML forms connected to CORBA objects. The mechanism that is used to link the controls to CORBA objects is the <SERVLET> tag. When the <FORM> is rendered, the servlet tag is placed at the end of each form. The object invoked by this servlet tag is the gateway object
. Servlets are modules that run inside of servlet-enabled Web servers, extending their functionality. When you request client-side navigation buttons as part of the client layout, the servlet tag generates JavaScript that appears on the client HTML page. The HTML browser must be at least Internet Explorer 4.0 or Netscape 4.0 or higher when JavaScript is used. For more information on servlets, see the "Developing servlets" chapter.
To create an HTML client from an IDL file,
More detailed information on each step is provided in the following sections.To create the IDL file, first, create a new project.
To create and enter the code for the IDL file,
BankTutorial.IDL
in the File Name field. Click OK. A sample IDL file is created and added to the project.
module BankTutorial { interface Account { float balance(); }; interface AccountManager { Account open(in string name); }; };
To compile the BankTutorial.idl
file,
BankTutorial.idl
file in the project pane.
Two files are generated by the wizard. If the BankTutorial.idl
file is used, as in this example, the files are:
FormBankTutorial.jsp
- a JavaServer Page
BankTutorial.BankTutorial.clienthtml
- contains the JavaBeans generated for each interface defined in the IDL file
By default, the HTML client can do the following:
The JSP file does this by placing PARAM tags within the SERVLET tag. Some HTML editing tools remove PARAM tags from within a SERVLET tag. To prevent this from happening, the SERVLET tag is bracketed by comment tags that are understood by the editing tools.
The following sections discuss testing the HTML client using the JSP that was generated by the application. The general steps for running this application are
The Web View page of the content pane displays the JSP. For local testing, the URL points to localhost:8080
, which is where Tomcat is running. The output/log data from Tomcat will appear on a new tab in the Message pane. Output from servlets or beans, as well as HTTP commands and parameter values, are echoed to this pane. Run-time properties of the Web server may be set by selecting Project|Project Properties, and selecting JSP/Servlet on the Run tab. The port number is the port on which the Web server will run. The default is 8080. If port 8080 is in use, by default JBuilder will search for an unused port.
For development purposes JBuilder uses the Tomcat Web server to execute the JSP. For deployment onto a production Web server, consult the documentation for that Web server for information on how to deploy HTML client applications to it.
Once you have deployed your application, you can run the client and server on either the same machine or on different machines in the same subnet.