All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.buyexpressly.api.MerchantPluginServlet Maven / Gradle / Ivy

Go to download

Expressly Java SDK to integrate e-commerce platforms with the Expressly Network API

There is a newer version: 2.3.1
Show newest version
package com.buyexpressly.api;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Objects;

public class MerchantPluginServlet extends HttpServlet {
    private MerchantServiceRouter router;

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        router = (MerchantServiceRouter) Objects.requireNonNull(config.getServletContext().getAttribute(
                MerchantServiceRouter.class.getName()),
                String.format(
                        "Instance of [%s] not found under ServletContext attribute [%s]",
                        MerchantServiceRouter.class.getCanonicalName(),
                        MerchantServiceRouter.class.getName()));
    }

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        router.route(req, resp);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy