package ro.satrapu.jeedeploytocloud;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.MessageFormat;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author satrapu
 */
@WebServlet(name = "StatusServlet", urlPatterns = {"/status"})
public class StatusServlet extends HttpServlet {

    private static final long serialVersionUID = 1L;

    /**
     * Processes HTTP requests.
     *
     * @param request  servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException      if an I/O error occurs
     */
    private static void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");

        try (PrintWriter out = response.getWriter()) {
            out.println("<!DOCTYPE html>");
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet Status</title>");
            out.println("</head>");
            out.println("<body>");
            out.println("<h1>Servlet Status</h1>");

            Map<String, String> statusInfo = getStatusInfo(request);
            writeStatus(statusInfo, out);

            out.println("</body>");
            out.println("</html>");
        }
    }

    /**
     * @param request
     * @return
     */
    private static Map<String, String> getStatusInfo(HttpServletRequest request) {
        Map<String, String> result = new LinkedHashMap<>();
        result.put("Server IP", "" + request.getLocalAddr());
        result.put("Server name", "" + request.getLocalName());
        result.put("Server port", "" + request.getLocalPort());
        result.put("Client name", request.getRemoteHost());
        result.put("Client IP", request.getRemoteAddr());
        result.put("Request context path", request.getContextPath());
        result.put("Request method", request.getMethod());
        result.put("Current date", DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(new Date()));

        return result;
    }

    /**
     * @param statusInfo
     * @param writer
     */
    private static void writeStatus(Map<String, String> statusInfo, PrintWriter writer) {
        writer.println("<ul>");

        for (String key : statusInfo.keySet()) {
            String value = statusInfo.get(key);

            writer.println("<li>");
            writer.println(MessageFormat.format("{0}: {1}", key, value));
            writer.println("</li>");
        }

        writer.println("</ul>");
    }

    /**
     * Handles the HTTP <code>GET</code> method.
     *
     * @param request  servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException      if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Handles the HTTP <code>POST</code> method.
     *
     * @param request  servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException      if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        processRequest(request, response);
    }
}

@@ -319,19 +319,22 @@
 va.text.
-Dat
+Messag
 eFormat;
@@ -347,33 +347,33 @@
 t java.t
-ext.MessageFormat
+ime.LocalDateTime
 ;%0Aimport
@@ -382,17 +382,37 @@
 ava.
-u
 ti
-l.Date
+me.format.DateTimeFormatter
 ;%0Aim
@@ -1478,38 +1478,38 @@
     Map%3CString, 
-String
+Object
 %3E statusInfo = g
@@ -1747,22 +1747,22 @@
 String, 
-String
+Object
 %3E getSta
@@ -1819,22 +1819,22 @@
 String, 
-String
+Object
 %3E result
@@ -1890,21 +1890,16 @@
 ver IP%22,
- %22%22 +
  request
@@ -1949,21 +1949,16 @@
 r name%22,
- %22%22 +
  request
@@ -2012,13 +2012,8 @@
 rt%22,
- %22%22 +
  req
@@ -2030,24 +2030,96 @@
 calPort());%0A
+        result.put(%22Java version%22, System.getProperty(%22java.version%22));%0A
         resu
@@ -2133,20 +2133,18 @@
 %22Client 
-name
+IP
 %22, reque
@@ -2159,12 +2159,12 @@
 mote
-Host
+Addr
 ());
@@ -2183,34 +2183,36 @@
 ult.put(%22Client 
-IP
+name
 %22, request.getRe
@@ -2207,36 +2207,36 @@
 equest.getRemote
-Addr
+Host
 ());%0A        res
@@ -2256,20 +2256,11 @@
 est 
-context path
+URI
 %22, r
@@ -2273,19 +2273,18 @@
 .get
-ContextPath
+RequestURI
 ());
@@ -2386,84 +2386,60 @@
 Date
-Format.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(new Date
+TimeFormatter.ISO_DATE_TIME.format(LocalDateTime.now
 ()))
@@ -2581,22 +2581,22 @@
 String, 
-String
+Object
 %3E status
@@ -2717,22 +2717,22 @@
         
-String
+Object
  value =
@@ -3834,40 +3834,95 @@
     
-processRequest(request, response
+throw new ServletException(new UnsupportedOperationException(%22POST verb not supported%22)
 );%0A 

Add more environment info. POST request are no longer supported.