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
About this task
- For the CICS Hello World example, the CICS TS queue example, and the CICS JDBC sample:
- 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 namecom.ibm.cics.server.examples.wlp.tsq
, and the JDBC example has the namecom.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.
- 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.
- 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.
- Open a web browser and enter a URL in the following format:
- For the CICS Link to Liberty sample:
- 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.
- Put a container called NAME on the channel, and link with that channel with the following
commands:
The contents of the NAME container is in the output message:CECI PUT CONTAINER(NAME) CHAR FROM(USER) CHANNEL(CHAN) CECI LINK PROG(HELLOWLP) CHANNEL(CHAN)
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.