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 Liberty
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 a WAB, as part of 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
- Create a dynamic web project for your application. You must update your build path to add the
Liberty libraries.
- Right-click the dynamic web project and click . The properties dialog opens for the project.
- In the Java Build Path, click the
Libraries tab.
- Click Add Library and select Liberty JVM Server
Libraries.
- Click Next, select the CICS
version, then click Finish to complete adding the library.
- Click OK to save your changes.
- 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 SDK for Java EE and Liberty includes examples of
web components that use JCICS and JDBC.
- 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 SDK for Java EE and Liberty includes a template for this file
that contains the correct information for CICS. See Authenticating users in a Liberty JVM server for further information.
- 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.
- 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.