BEA Logo BEA Tuxedo Release 8.0

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   Tuxedo Documentation   |   Using BEA Jolt   |   Local Topics   |   Previous Topic   |   Next Topic   |   Contents   |   Index

 


Jolt Servlet Connectivity Sample

The Jolt software includes three sample applications that demonstrate servlet connectivity using the Jolt servlet classes. The three samples are:

Refer to these samples to see code examples of how to use the Jolt servlet classes in your own servlets.

Viewing the Sample Servlet Applications

To view the code for the Jolt sample applications, you need to install the Jolt API client classes (usually chosen as an option when installing Jolt). Once the classes are installed in your directory of choice, navigate to the following directory to see the sample application files:

<Installation directory>\udataobj\jolt\examples\servlet

To view the sample code, use a text editor such as Microsoft Notepad to open the Java files for each sample application.

SimpApp Sample

A sample application named simpapp is included with Jolt. The simpapp application illustrates how the servlet uses Servlet Connectivity for BEA Tuxedo. The following servlet tasks are illustrated by the SimpApp sample:

This example demonstrates how a servlet can connect to BEA Tuxedo and call upon one of its services; it should be invoked from the simpapp.html file. The servlet creates a session pool manager at initialization, which is used to obtain a session when the doPost() method is invoked. This session is used to connect to a service in BEA Tuxedo with a name described by the posted "SVCNAME" argument. In this example the service is called "TOUPPER", which transposes the posted "STRING" argument text into uppercase, and returns the result to the client browser within some generated HTML.

Note: The WebLogic Server is used in this example.

Requirements for Running the SimpApp Sample

The requirements for running the SimpApp sample are:

Installing the SimpApp Sample

  1. Install the Jolt class library (jolt.jar) and Servlet Connectivity for BEA Tuxedo class library (joltjse.jar) on the Web application server. Extract the class files if it is required by your Web application server.

  2. Compile the SimpAppServlet.java. Make sure that you include the standard JDK 1.1.x classes.zip, JSDK 1.1 classes, Jolt class library, and Servlet Connectivity for BEA Tuxedo class library in the classpath.
    javac -classpath $(JAVA_HOME)/lib/classes.zip:$(JSDK)/lib/servlet.jar:
    	$(JOLTHOME)/jolt.jar:$(JOLTHOME)/joltjse.jar:./classes
    		-d ./classes SimpAppServlet.java

    Note: The package name of the SimpAppServlet is examples.jolt.servlet.simpapp.

  3. Put the simpapp.html and simpapp.properties files in the public HTML directory.

  4. Modify the simpapp.properties file. Change the "appaddrlist" and "failoverlist" with the proper Jolt server hosts and ports. Specify the proper BEA Tuxedo authentication information if the SimpApp has security turned on. For example:
    	#simpapp
    	#Fri Apr 16 00:43:30 PDT 1999
    	poolname=simpapp
    	appaddrlist=//host:7000,//host:8000
    	failoverlist=//backup:9000
    	minpoolsize=1
    	maxpoolsize=3
    	userrole=tester
    	apppassword=appPass
    	username=guest
    	userpassword=myPass

  5. Register "Simpapp" for the SimpAppServlet. Consult your Web application server for details. If you are using BEA WebLogic Server, add the following section of the config.xml file:
    <Application
    Deployed="true"
    Name="simpapp"
    Path=".\config\mydomain\applications"
    >
    <WebAppComponent
    Name="simpapp"
    Targets="myserver"
    URI="simpapp"
    />
    </Application>

  6. To access the SimpApp initial page "simpapp.html," type:

    http://mywebserver:8080/simpapp.html

BankApp Sample

The bankapp application illustrates how the servlet is written with PageCompiledServlet with Servlet Connectivity for BEA Tuxedo. bankapp illustrates how to:

Requirements for Running the BankApp Sample

Following are the requirements for running the BankApp sample:

Installation Instructions

  1. Install the Jolt class library (jolt.jar) and Servlet Connectivity for BEA Tuxedo class library (joltjse.jar) to the Web application server. Extract the class files if it is required by your Web application server.

  2. Copy all HTML, JHTML and bankapp.properties files to the public HTML directory of the Web application server (for example, $WEBLOGIC/myserver/public_html for WebLogic):
    	bankapp.properties
    	tellerForm.html
    	inquiryForm.html
    	depositForm.html
    	withdrawalForm.html
    	transferForm.html
    	InquiryServlet.jhtml
    	DepositServlet.jhtml
    	WithdrawalServlet.jhtml
    	TransferServlet.jhtml

  3. Modify the bankapp.properties file. Change the "appaddrlist" and "failoverlist" with the proper Jolt server hosts and ports. Specify the proper BEA Tuxedo authentication information if the BankApp has security turned on. For example:
    	#bankapp
    	#Fri Apr 16 00:43:30 PDT 1999
    	poolname=bankapp
    	appaddrlist=//host:8000,//host:7000
    	failoverlist=//backup:9000
    	minpoolsize=2
    	maxpoolsize=10
    	userrole=teller
    	apppassword=appPass
    	username=JaneDoe
    	userpassword=myPass

  4. If applicable, turn on the automatic page compilation for JHTML from your servlet engine. Consult the user manual of your Web application server for details.

  5. To access BankApp through Servlet Connectivity for BEA Tuxedo, use the following URL in your favorite browser:

    http://mywebserver:8080/tellerForm.html

Admin Sample

The Admin sample application illustrates the following servlet tasks:

Requirements for Running the Admin Sample

Following are the requirements for running the Admin sample:

Installation Instructions

  1. Install the Jolt class library and Servlet Connectivity for BEA Tuxedo class library on the Web application server.

  2. Copy all JHTML files to the public HTML directory (for example, $WEBLOGIC/myserver/public_html for WebLogic):
    	PoolList.jhtml
    	PoolAdmin.jhtml

  3. To get a list of session pools, use the following URL in your favorite browser:

    http://mywebserver:8080/PoolList.jhtml

 

back to top previous page next page