Creating a dynamic web project

To develop a web presentation layer for your Java™ application, you can create a dynamic web project.

Before you begin

Ensure that the web development tools are installed in your Eclipse IDE. For more information, see Setting up the development environment.

A restriction added by the Liberty Profile, and introduced by an APAR applied to CICS® TS V5.1, prevents access to OSGi bundles from servlets that are deployed in a WAR file. The restriction includes access to OSGi bundles installed directly in a CICS bundle. To overcome this restriction, you must deploy your application as an EBA (OSGi Application project). An EBA is a container in which Web and OSGi components can interact.

About this task

The CICS Explorer and CICS Explorer SDK help provides full details on how you can complete each of the following steps to develop and package web applications.

Procedure

  1. Create a dynamic web project for your application. You must update your build path to add the Liberty Libraries.
    1. Right-click the dynamic web project and click Build Path > Configure Build Path. The properties dialog opens for the project.
    2. In the Java Build Path, click the Libraries tab.
    3. Click Add Library and select Liberty JVM server libraries.
    4. Click Next, select the CICS version and click Finish to complete adding the library.
    5. Click OK to save your changes.
  2. Develop your web application. You can use the JCICS API to access CICS services, JDBC to access DB2® and JMS to access IBM® MQ. The CICS Explorer SDK includes examples of web components that use JCICS and JDBC.
  3. Optional: If you want to secure the application with CICS security, create a web.xml file in the dynamic web project to contain a CICS security constraint. The CICS Explorer SDK includes a template for this file that contains the correct information for CICS. See Authenticating users in a Liberty JVM server for further information.
  4. Create one or more CICS bundle projects to package your application. Add definitions and imports for CICS resources. Each CICS bundle contains an ID and version so you can manage changes in a granular way.
  5. Optional: Add a URIMAP and TRANSACTION resource to a CICS bundle if you want to map inbound web requests from a URI to run under a specific transaction. If you do not define these resources, all work runs under a supplied transaction, which is called CJSA. These resources are installed dynamically and managed as part of the bundle in CICS.

Results

You set up your development environment, created a web application from a dynamic web project, and packaged it for deployment.

What to do next

When you are ready to deploy your application, export the CICS bundle projects to zFS. The referenced projects are built and included in the transfer to zFS. Alternatively, you can follow the Liberty deployment model by exporting the application as a WAR and deploying it to the dropins directory of a running Liberty JVM server.