Running the servlet examples

To run the servlet examples, you can access the applications from a web browser. This topic applies to CICS integrated-mode Liberty only.

Before you begin

You must deploy an example to a Liberty JVM server, as described in Deploying the servlet examples. You must also make sure that the server.xml file contains a valid port number and host name.

About this task

The Liberty server uses the Java TCP/IP sockets layer to accept HTTP and HTTPS requests from web browsers. You can use a web browser to check that your application is available and that your Liberty JVM server is configured to accept application requests.
  • For the CICS Hello World example, the CICS TS queue example, and the CICS JDBC sample:
    1. Open a web browser and enter a URL in the following format:
      http://hostname:port/app_name/
      • hostname is the name of the host or IP address where you are running the Liberty JVM server.
      • port is the HTTP or HTTPS port number that is configured in the server.xml file.
      • app_name is the name of the example that you deployed. The hello world example has the name com.ibm.cics.server.examples.wlp.hello, the TS queue example has the name com.ibm.cics.server.examples.wlp.tsq, and the JDBC example has the name com.ibm.cics.server.examples.wlp.jdbc.
      Tip: The name of the application, host name, and port are written to the Liberty server messages.log file when the application is successfully deployed. You can copy the URL from the log into your web browser to access to display the starting page for the application.

      The web application is displayed in the web browser.

    2. You can interact with the web application.

      The hello world example just displays a web page to confirm your Liberty JVM server is running in CICS. However, you can interact with the TS queue and JDBC examples.

      Interacting with the TS queue example
      You can use the TS queue example to create, browse, and delete temporary storage queues in the CICS region. To create a temporary storage queue, enter a name in the field TSQ, enter some test data in the field Record, and click Write TSQ. The record that you entered is returned underneath. The TS queue name, type, and number of records are also returned on the web page. You can add as many records as you like.
      To browse a temporary storage queue, enter the name of the queue and click Browse TSQ. To delete a temporary storage queue, enter the name of the queue and click Delete TSQ.
      Interacting with the JDBC example
      You can use the JDBC example to view and filter sample data from DB2®. The web page shows all the records for the sample DB2 table. You can apply filters to the table columns to change the data that is returned. Click the drop-down menu next to a column to change the filter, for example select the greater than symbol, and enter a value in the field. Click Update to return the filtered data from DB2. Click Reset to remove the filters.
  • For the CICS Link to Liberty sample:
    1. Use CECI to invoke the PROGRAM: CECI LINK PROG(HELLOWLP). The message Hello <USERNAME> from Liberty server defaultServer is in the STDOUT for your JVM server.
    2. Put a container called NAME on the channel, and link with that channel with the following commands:
      CECI PUT CONTAINER(NAME) CHAR FROM(USER) CHANNEL(CHAN) 
      CECI LINK PROG(HELLOWLP) CHANNEL(CHAN)
      The contents of the NAME container is in the output message:
      Hello USER from Liberty server defaultServer
    Note: These commands must be issued from the same CECI session.
    For further information, see Linking to a Java EE application from a CICS program.

Results

You successfully configured and tested an example web application.