Package net.sourceforge.plantuml.servlet
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 -
Method Summary
Modifier and TypeMethodDescriptionvoiddoGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) static booleanforbiddenURL(String full) static HttpURLConnectiongetConnection(URL url) Get open http connection from URL.static URLvalidateURL(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, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
ProxyServlet
public ProxyServlet()
-
-
Method Details
-
forbiddenURL
-
validateURL
public static URL validateURL(String url, jakarta.servlet.http.HttpServletResponse response) throws IOException Validate external URL.- Parameters:
url- URL to validateresponse- 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:
doGetin classjakarta.servlet.http.HttpServlet- Throws:
IOExceptionjakarta.servlet.ServletException
-
getConnection
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
-