Developer's-Panther WebSphere


Appendix B. Sample Applications

The distribution includes some EJB samples developed for the Panther for IBM WebSphere product. The samples are located at:

PantherInstallDir/samples/ejb

How to Install the EJB Samples

Follow the instructions listed in:

PantherInstallDir/samples/ejb/ejbinstall.htm

Warning: Before starting the EJB Gallery server, you must first stop the Web Gallery server. Otherwise, you get the message "internal Windows error."


Using a Web Banner

Feature:
Provide simple EJB that can be called from any client.

Description:
Users display a simple web page containing a button that submits the screen. Each time the screen is submitted with this push button, a new random ad appears on the screen. The ad consists of an image, a URL that will be invoked when the ad is clicked, and alternative text for the ad. All of this information comes from the AdServer component, which has a grid containing rows of information for possible ads.

Language(s) Used:
JPL

Client Screen:
Name: adserver.scr

Component:
Name: AdServer

Component Methods:
newadd() returns three arguments: ad_image, ad_text, and ad_url.


Finding Your Horoscope

Feature:
Use of Java inside client and EJB

Description:
Users display a screen where they can enter their birthday, and then click on a push button to see their horoscope.

Language(s) Used:
Java

Client Screen:
Name: horoscope.scr

callfortune_pb: Push button that invokes newfortune() method.

Java Files: FortuneClient.java, FortuneClient.class (in $SMBASE/samples/ejb/ejbclient.lib)

Component:
Name: Fortune

Java Files: FortuneLogic.java, FortuneLogic.class (in $SMBASE/samples/ejb/server.lib)

Component Methods:
newfortune()- This method is passed a date, and returns a text string (255 characters) containing a fortune, based on the Astrological Sign of the date.


Running the eStore Application

Feature:
Provide a sample EJB that makes database calls.

Description:
Users see a list of items. They can click on the items to add them to their shopping cart. When they press "Checkout," it takes them to the checkout screen, where they can enter their customer information.

Language(s) Used:
JPL

Client Screens:
fillcart.scr, viewcart.scr, checkout.scr

Components:
Carts, Store