Java web applications

CICS® provides a web container that can run lightweight Java™ servlets and JavaServer Pages. Developers can use the rich features of the Java servlet and JSP specifications to write modern web applications for CICS. The web container runs in a JVM server and is built on the WebSphere® Application Server Liberty profile technology.

The Liberty profile is a lightweight web container for application development that starts quickly and can run on different platforms. It is optimized for Java developers to quickly develop and test applications, requiring a minimal amount of effort to configure and start the web server. Java developers package the application and web server together for simple deployment by using Eclipse tools that are freely available. For more information about the Liberty profile, see Developing applications in the Liberty profile environment.

Start of changeCICS uses some of the features in the Liberty profile to run web applications in a JVM server. Specifically, CICS provides support for the following features:
  • JavaServer Faces (JSF) 2.0
  • JavaServer Pages (JSP) 2.2
  • Java Servlet 3.0
  • Start of changeJava API for RESTful Web Services (JAX-RS)End of change
  • Start of changeJavaScript Object Notation (JSON4J) LibraryEnd of change
  • Secure Sockets Layer (SSL) 1.0
End of change

CICS provides its own security feature and registry for providing transaction security to secure applications. You must use this feature when CICS security is enabled. Basic authentication is supported, but you cannot use client certificates to provide authentication credentials for CICS applications.

If CICS security is not enabled, you can use Liberty security for authentication. However, you must use a basic registry in the server.xml file. Other types of registry are not supported.

For JDBC, an application can directly access a database by using a JDBC DriverManager, as described in the DB2® servlet example that is supplied with the CICS Explorer® SDK.

You might want to use the Liberty JVM server and associated tools for any of the following reasons:

Java developers can use the CICS Explorer SDK in an Eclipse IDE with Liberty profile developer tools to develop, package, and deploy an application on CICS. The CICS Explorer SDK also provides examples to quickly get started. The following examples describe how you can run Java web applications in a Liberty JVM server.

Deploy Java applications using the Liberty profile model

The Liberty JVM server follows the application development and deployment model for the Liberty profile as closely as possible, while taking advantage of the services and application lifecycle that are provided by CICS. The Liberty profile technology is installed with CICS and contains a set of built-in configuration defaults.

If -Dcom.ibm.cics.jvmserver.wlp.autoconfigure=true in the JVM profile, the Liberty JVM server automatically creates the configuration files from the templates when it starts, to minimize setup time. However, you can override these defaults in the server.xml configuration file or supply the configuration file before the startup if you want complete control.

If -Dcom.ibm.cics.jvmserver.wlp.autoconfigure=false, which is the default value, CICS does not do any configuration. A fully configured server must exist in the directory that is specified by WLP_USER_DIR.

The Liberty JVM server starts an OSGi framework, so you can run WAR files and OSGi bundles in the same JVM server. It listens for HTTP and HTTPS requests that use TCP/IP sockets instead of CICS, runs the business logic for application requests, and sends the response back to the client.

You can choose to deploy a web application directly on the dropins directory of the Liberty JVM server. The Liberty JVM server automatically installs the application in the OSGi framework. However, CICS is not aware of the application and you cannot use the application lifecycle management that is provided by CICS. This type of deployment might be suitable for developing and testing an application.

Deploy Java applications using the CICS application model

CICS provides application lifecycle management through CICS bundles. CICS bundles are a unit of packaging and deployment for managing resources together. You can use CICS bundles to package and deploy a set of related OSGi bundles and web projects together. CICS bundles can also contain related CICS resources, such as programs, transactions, and URI maps, which might be required by the application. CICS bundles have IDs and versions to make it easier to update and manage the application.

For deployment, you do not drop the CICS bundles directly to the dropins directory of the Liberty JVM server. Instead, you deploy them on a zFS directory and define a BUNDLE resource in the CICS region that owns the JVM server. The BUNDLE resource lifecycle determines the availability of the Java application in CICS. When you install the BUNDLE resource, the OSGi bundles and WAR files are installed in the Liberty JVM server. You can enable and disable the BUNDLE resource, and also find out which OSGi bundles and services are installed for each BUNDLE resource.

If you want to run a Java application in a platform, you can group the CICS bundles together into an application bundle and deploy the whole application in a single deployment step. When you install the application, the CICS bundles are installed in every region.



liberty_overview.html | Timestamp icon Last updated: Thursday, 27 June 2019