
/*
 *  Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
*/
package com.vision.cloud.idm;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * Simplest servlet that shows up if a user logs in with the right credential.
 * This can be used to test if the shared identity is setup properly or not.
 */
public class Greeting extends HttpServlet {
    private static final String CONTENT_TYPE =
        "text/html; charset=windows-1252";
    
    public void service(HttpServletRequest request,
                        HttpServletResponse response) throws ServletException,
                                                             IOException {
        response.setContentType(CONTENT_TYPE);
        PrintWriter out = response.getWriter();
        
        out.println("<!DOCTYPE html>");
        out.println("<html>");
        out.println("<head>");
        out.println("<title>Test access to servlet</title>");
        out.println("<link rel='stylesheet' type='text/css' href='vision.css'>");
        out.println("</head>");
        out.println("<body>");
        out.println("<div id=\"content\">");
        out.println("<div id=\"hd\">");
        out.println("<img src=\"vision.png\"></a>");
        out.println("<h1>Welcome to the <B>Oracle Java Cloud Service</B>. You are authorised to access this page</h1>");
        out.println("</div>");
        out.println("<div id=\"ft\">");
        out.println("<p>Provided by Oracle Java Cloud Service</p>");
        out.println("</div>");
        out.println("</div>");
        out.println("</body>");
        out.println("</html>");
        
        out.close();
    }

}
