Skip Headers
Oracle® Fusion Middleware Platform Developer's Guide for Oracle Real-Time Decisions
11g Release 1 (11.1.1)

Part Number E16630-04
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

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 site:

    http://developers.sun.com/downloads

    For more details about supported versions, see the documents referenced in Section 6.4, "System Requirements and Certification."

  2. Install the Oracle RTD files and deploy Oracle RTD to an application server. See Oracle Fusion Middleware Installation Guide for Oracle Business Intelligence 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. For details, see the section "Populating the CrossSell Example Data" in Oracle Fusion Middleware Administrator's Guide for Oracle Real-Time Decisions and Part III, "Decision Studio Reference" for information about deploying Inline Services.

  4. Start Real-Time Decision Server. For more information, see Oracle Fusion Middleware Administrator's Guide for Oracle Real-Time Decisions.

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 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.

  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

    The first web page that appears prompts you for username and password. After you have provided both, 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"

  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-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"

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