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

network.oxalis.ng.inbound.servlet.HomeServlet Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2010-2018 Norwegian Agency for Public Management and eGovernment (Difi)
 *
 * Licensed under the EUPL, Version 1.1 or – as soon they
 * will be approved by the European Commission - subsequent
 * versions of the EUPL (the "Licence");
 *
 * You may not use this work except in compliance with the Licence.
 *
 * You may obtain a copy of the Licence at:
 *
 * https://joinup.ec.europa.eu/community/eupl/og_page/eupl
 *
 * Unless required by applicable law or agreed to in
 * writing, software distributed under the Licence is
 * distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied.
 * See the Licence for the specific language governing
 * permissions and limitations under the Licence.
 */

package network.oxalis.ng.inbound.servlet;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.typesafe.config.Config;

import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@Singleton
public class HomeServlet extends HttpServlet {

    private final Config config;

    @Inject
    public HomeServlet(Config config) {
        this.config = config;
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        resp.setContentType("text/html;charset=UTF-8");
        PrintWriter writer = resp.getWriter();

        writer.print("\n" +
                "\n" +
                "    \n" +
                "        \n" +
                "        Oxalis - Next Generation Home\n" +
                "        " +
                "    \n" +
                "    \n"+
                "    
"); if (config.hasPath("access.point.logo")) { writer.print("\"Destination"); } writer.print("
"); if (config.hasPath("access.point.name")) { writer.print("

Welcome to '" + config.getString("access.point.name") + "' AP Home

Powered by Next Generation Oxalis (Oxalis-NG)
"); } else { writer.print("

Welcome to the AP Home

Powered by Next Generation Oxalis (Oxalis-NG)
"); } writer.print("The AS4 endpoint is served at: here"); writer.print("

Important version, certificate and related information can be found at: status

\n"); writer.print("

NOTE:Status information is only for debugging and internal support purpose so please consider blocking access to this page.

\n"); writer.print("
"); writer.print(""); writer.print(""); } }