Catalyst AppSail

Catalyst AppSail is a fully-managed, independent platform for deploying web services to the cloud with ease. You can either deploy your application directly as a Catalyst-managed runtime that supports specific runtimes of Java, Node.js, and Python, or an OCI-compliant container image of your application as a custom-runtime.

Catalyst enables you to implement Java SDK in your AppSail applications for Catalyst-managed runtimes. AppSail supports frameworks of Java such as Embedded Jetty, Spring MVC, and Spring Boot. You can access help guides for building sample apps in Java.

Implement Java SDK in AppSail

You can implement the Catalyst Java SDK in the codebase of your AppSail service with ease. The steps to implement and initialize the Catalyst SDK for different API versions of Java servlets are demonstrated with sample codes below.

In all cases, Catalyst requires you to implement the AuthHeaderProvider interface from the Catalyst Java SDK package. The implementation defines the getHeader() method that returns the value of the request header. You can then pass an object of the implementation class to the init() method, to initialize the SDK.

Java Servlet API versions <=4

Sample code for Java applications that use Java servlets of API versions lesser than or equal to 4.0 (javax.servlet):

Implementation Class:

copy
package com.zoho.catalyst.appsail.demo.utils;
import javax.servlet.http.HttpServletRequest;
import com.zc.auth.AuthHeaderProvider;
public class AuthProviderImpl implements AuthHeaderProvider {
 HttpServletRequest request;
 public AuthProviderImpl(HttpServletRequest request) {
  this.request = request;
 }
 @Override
 public String getHeaderValue(String key) {
  return request.getHeader(key);
 }
}

Initialization:

copy
AuthProviderImpl authProviderImpl = new AuthProviderImpl(req);
CatalystSDK.init(authProviderImpl)

Java Servlet API versions >=5

Sample code for Java applications that use Java servlets of API versions greater than or equal to 5.0 (jakarta.servlet):

Implementation Class:

copy
import com.zc.auth.AuthHeaderProvider;
import jakarta.servlet.http.HttpServletRequest;
public class AuthProviderImpl implements AuthHeaderProvider {
    private HttpServletRequest request;
    AuthProviderImpl(HttpServletRequest request) {
        this.request = request;
    }
    @Override
    public String getHeaderValue(String s) {
        return request.getHeader(s);
    }
}

Initialization:

copy
CatalystSDK.init(new AuthProviderImpl((HttpServletRequest) servletRequest));

Implement Java SDK in a Maven Project

If you are developing a Java application with the Maven build tool, you can include the Catalyst Java SDK as a dependency in the Maven configuration file (pom.xml), instead of downloading and adding the SDK in your source code manually.

To add the Catalyst SDK in a Maven project, simply add the Zoho repository (published in MvnRepository) in the pom.xml file as shown below:

copy
<repositories>
	<repository>
      <id>java-sdk</id>
      <url>https://maven.zohodl.com</url>
    </repository>
  </repositories>

You can then add the Java SDK as a dependency in pom.xml as shown below:

copy
<dependencies>
    <dependency>
      <groupId>com.zoho.catalyst</groupId>
      <artifactId>java-sdk</artifactId>
      <version>1.15.0</version>
    </dependency>
 </dependencies>

Last Updated 2026-03-05 20:50:59 +0530 IST