![]() |
![]() |
|
|
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 in 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:
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.
#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
weblogic.httpd.register.simpapp=examples.jolt.servlet.SimpAppServlet
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:
bankapp.properties
tellerForm.html
inquiryForm.html
depositForm.html
withdrawalForm.html
transferForm.html
InquiryServlet.jhtml
DepositServlet.jhtml
WithdrawalServlet.jhtml
TransferServlet.jhtml
#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
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:
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
![]() |
![]() |
![]() |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|