Running the servlet examples

To run the servlet examples, you can access the applications from a web browser.

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. The samples are set up to use HTTPS.

About this task

The Liberty profile 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.

Procedure

  1. Open a web browser and enter a URL in the following format:
    https://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 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.web, the TS queue has the name com.ibm.cics.server.examples.wlp.tsq.web, and the JDBC example has the name com.ibm.cics.server.examples.wlp.jdbc.web.
    Tip: The name of the application, host name, and port is written to dfhjvmout when the application is successfully deployed. You can copy the URL from the log into your web browser to access the application, but remove the /* at the end of the URL 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.

Results

You successfully configured and tested an example web application.