|
|
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
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
<Application
Deployed="true"
Name="simpapp"
Path=".\config\mydomain\applications"
>
<WebAppComponent
Name="simpapp"
Targets="myserver"
URI="simpapp"
/>
</Application>
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
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:
Installation Instructions
PoolList.jhtml
PoolAdmin.jhtml
http://mywebserver:8080/PoolList.jhtml
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|