Class ProxyServlet

  • All Implemented Interfaces:
    jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

    public class ProxyServlet
    extends jakarta.servlet.http.HttpServlet
    Proxy servlet of the webapp. This servlet retrieves the diagram source of a web resource (web html page) and renders it.
    See Also:
    Serialized Form
    • Constructor Detail

      • ProxyServlet

        public ProxyServlet()
    • Method Detail

      • forbiddenURL

        public static boolean forbiddenURL​(String full)
      • validateURL

        public static URL validateURL​(String url,
                                      jakarta.servlet.http.HttpServletResponse response)
                               throws IOException
        Validate external URL.
        Parameters:
        url - URL to validate
        response - response object to `sendError` including error message; if `null` no error will be send
        Returns:
        valid URL; otherwise `null`
        Throws:
        IOException - `response.sendError` can result in a `IOException`
      • doGet

        public void doGet​(jakarta.servlet.http.HttpServletRequest request,
                          jakarta.servlet.http.HttpServletResponse response)
                   throws IOException,
                          jakarta.servlet.ServletException
        Overrides:
        doGet in class jakarta.servlet.http.HttpServlet
        Throws:
        IOException
        jakarta.servlet.ServletException
      • getConnection

        public static HttpURLConnection getConnection​(URL url)
                                               throws IOException
        Get open http connection from URL.
        Parameters:
        url - URL to open connection
        Returns:
        open http connection
        Throws:
        IOException - if an input or output exception occurred