Class ProxyServlet

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
net.sourceforge.plantuml.servlet.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:
  • Field Summary

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
     
    static boolean
     
    Get open http connection from URL.
    static URL
    validateURL(String url, jakarta.servlet.http.HttpServletResponse response)
    Validate external URL.

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, service

    Methods inherited from class jakarta.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProxyServlet

      public ProxyServlet()
  • Method Details

    • 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