Skip Headers
Oracle® Real-Time Decisions Platform Developer's Guide
Version 3.0.0.1

Part Number E13854-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

8 Using Java Smart Client JSP Tags

A convenient way to integrate a Web application with a deployed Inline Service is to use the JSP client integration tags. JSP allows you to generate interactive Web pages that use embedded Java. The JSP tags provided are based on the Java Smart Client discussed in the previous chapter.

There is negligible overhead when using the JSP tags. In addition, the tags incorporate automatic reuse of Smart Clients for same session to enhance performance. When a Java Smart Client is created using the JSP tag, a check is performed to see if a client already exists with the same name and properties and has not been closed. If it does, it automatically reuses that client; if not it will create a new one.

For full information about the JSP Smart Client tags, see the Decision Studio online help.

This chapter contains the following topics:

8.1 Before You Begin

You must perform the following tasks first before you can work with the JSP client integration tags:

  1. Install a Java Development Kit (JDK), with the JAVA_HOME environment variable set to its location. To obtain a JDK, go to the Sun Microsystems Web site at http://java.sun.com/products.

  2. Install the Oracle RTD files and deploy Oracle RTD to an application server. See Oracle Real-Time Decisions Installation and Administration Guide for full information.

  3. The Java Smart Client example works with the sample CrossSell Inline Service. Because of this, you must first populate the Oracle RTD Database with the CrossSell example data, then deploy the CrossSell Inline Service using Decision Studio.

    See Oracle Real-Time Decisions Installation and Administration Guide for information about populating the Oracle RTD Database with the CrossSell example data. See Part III, "Decision Studio Reference" for information about deploying Inline Services.

  4. Start Real-Time Decision Server. For more information, see Oracle Real-Time Decisions Installation and Administration Guide.

8.2 Integrating with an Inline Service Using Java Smart Client JSP Tags

In general, integration using the Java Smart Client includes the following steps:

  1. Prepare a properties file.

  2. Use an Invoke or AsyncInvoke tag to create a request to the server.

  3. Gather and parse any response information from Advisors.

  4. Close the connection.

A working example of using the Smart Client JSP tags for integration can be found at RTD_HOME\client\Client Examples\JSP Client Example\example.jsp.

8.3 Deploying the JSP Smart Client Example

Note:

If your Real-Time Decision Server port is not 8080, you must edit the client properties information before deploying the JSP Smart Client example, as follows:
  1. Open RTD_HOME\client\Client Examples\JSP Client Example\sdclient-test.war with WinZip or WinRAR.

  2. In sdclient-test.war, open client\sdclient.properties.

  3. Search for the entry:

    HTTP1.url = http://localhost:8080
    
  4. Change the URL localhost:8080 to match the host and port of the Real-Time Decision Server that you are using.

  5. Save the file back into sdclient-test.war.

For this example, the CrossSell Inline Service has been integrated to a simple command-line application to demonstrate how to use the Smart Client for integration. You need to deploy the JSP Smart Client example to your application server, as described in the following sections.

This section contains the following topics:

8.3.1 Deploying the JSP Smart Client Example to OC4J

To deploy the JSP Smart Client example to OC4J:

  1. Log in to the Application Server Control as the oc4jadmin user. You can access the Application Server Control at http://oc4j_host:port/em. For the standalone version of OC4J, the port number is typically 8888.

  2. On the OC4J home page, click the Applications tab.

    If you are using OC4J as part of Oracle Application Server, first click home under the Groups heading, then proceed to the Applications tab.

  3. Click Deploy. On the Deploy: Select Archive page, under the Archive heading, browse to specify the archive location RTD_HOME/client/Client Examples/JSP Client Example/sdclient-test.war. Then, click Next.

  4. On the Deploy: Application Attributes page, enter JSPClientExample for Application Name, then choose rtd-web-site for Bind Web Module to Site. Then, click Next.

  5. On the Deploy: Deployment Settings page, click Deploy.

  6. To access the application, open a Web browser and go to:

    http://ocj4_host:port/sdclient-test/example.jsp

    A Web page appears that simulates a service call, as shown in Figure 8-1.

    Figure 8-1 JSP Smart Client Example: Enter Customer ID

    Description of Figure 8-1 follows
    Description of "Figure 8-1 JSP Smart Client Example: Enter Customer ID"

  7. Enter a customer ID (such as 5) and click OK. A response page appears, displaying an offer and an option to end the call, as shown in Figure 8-2.

    Figure 8-2 JSP Smart Client Example: Displayed Offer

    Description of Figure 8-2 follows
    Description of "Figure 8-2 JSP Smart Client Example: Displayed Offer"

  8. Click the offer link, or click End this call.

8.3.2 Deploying the JSP Smart Client Example to WebSphere

To deploy the JSP Smart Client example to WebSphere:

  1. Access the Integrated Solutions Console at the URL http://websphere_host:port/ibm/console. At the login prompt, enter the administrator user name and password. On Windows, you can also access the Integrated Solutions Console through Start > Programs.

  2. In the tree on the left, expand Applications, then choose Enterprise Applications.

  3. Click Install.

  4. In the Path to the new application section, enter or browse to the path RTD_HOME/client/Client Examples/JSP Client Example/sdclient-test.war.

  5. For Context root, enter sdclient-test.

  6. Click Next, then click Next again, then click Next again.

  7. Click Finish, then click Save.

  8. On the Enterprise Applications page, select the sdclient-test application and click Start.

  9. To access the application, open a Web browser and go to:

    http://websphere_host:port/sdclient-test/example.jsp

    A Web page appears that simulates a service call, as shown in Figure 8-3.

    Figure 8-3 JSP Smart Client Example: Enter Customer ID

    Description of Figure 8-3 follows
    Description of "Figure 8-3 JSP Smart Client Example: Enter Customer ID"

  10. Enter a customer ID (such as 5) and click OK. A response page appears, displaying an offer and an option to end the call, as shown in Figure 8-4

    Figure 8-4 JSP Smart Client Example: Displayed Offer

    Description of Figure 8-4 follows
    Description of "Figure 8-4 JSP Smart Client Example: Displayed Offer"

  11. Click the offer link, or click End this call.

8.3.3 Deploying the JSP Smart Client Example to WebLogic

To deploy the JSP Smart Client example to WebLogic:

  1. Access the WebLogic Server Administration Console for your Oracle RTD domain at the URL http://weblogic_host:port/console. At the login prompt, enter the administrator user name and password. On Windows, you can also access the WebLogic Server Administration Console through Start > Programs > BEA Products > User Projects > domain_name > Admin Server Console.

  2. In the tree on the left, click Deployments.

  3. Click Install. You may need to click Lock & Edit first to enable the Install button.

  4. Go to RTD_HOME/client/Client Examples and select JSP Client Example, then click Next.

  5. Select Install this deployment as an application, then click Next.

  6. On the Optional Settings page, enter JSPClientExample for Name. Then, click Next.

  7. Review your settings and click Finish.

  8. Click Save, then click Activate Changes.

  9. Start the application by selecting JSPClientExample application in the Deployments table, then clicking Start > Servicing all Requests. When prompted, click Yes. The application is now running.

  10. To access the application, open a Web browser and go to:

    http://weblogic_host:port/sdclient-test/example.jsp

    A Web page appears that simulates a service call, as shown in Figure 8-5.

    Figure 8-5 JSP Smart Client Example: Enter Customer ID

    Description of Figure 8-5 follows
    Description of "Figure 8-5 JSP Smart Client Example: Enter Customer ID"

  11. Enter a customer ID (such as 5) and click OK. A response page appears, displaying an offer and an option to end the call, as shown in Figure 8-6.

    Figure 8-6 JSP Smart Client Example: Displayed Offer

    Description of Figure 8-6 follows
    Description of "Figure 8-6 JSP Smart Client Example: Displayed Offer"

  12. Click the offer link, or click End this call.