Package net.sourceforge.plantuml.servlet
Class AsciiCoderServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
net.sourceforge.plantuml.servlet.AsciiCoderServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
- Direct Known Subclasses:
PlantUmlServlet
public class AsciiCoderServlet
extends jakarta.servlet.http.HttpServlet
ASCII encoder and decoder servlet for the webapp.
This servlet encodes the diagram in text format or decodes the compressed diagram string.
- 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) protected voiddoPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected StringgetEncodedTextFromUrl(jakarta.servlet.http.HttpServletRequest request) Get encoded textual diagram source from URL.protected StringContext path from the servlet mapping URL pattern.protected net.sourceforge.plantuml.code.TranscoderGet PlantUML transcoder.Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPatch, 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
-
AsciiCoderServlet
public AsciiCoderServlet()
-
-
Method Details
-
getServletContextPath
Context path from the servlet mapping URL pattern.- Returns:
- servlet context path without leading or tailing slash
-
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
-
doPost
protected void doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException - Overrides:
doPostin classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletExceptionIOException
-
getTranscoder
protected net.sourceforge.plantuml.code.Transcoder getTranscoder()Get PlantUML transcoder.- Returns:
- transcoder instance
-
getEncodedTextFromUrl
protected String getEncodedTextFromUrl(jakarta.servlet.http.HttpServletRequest request) throws IOException Get encoded textual diagram source from URL.- Parameters:
request- http request which contains the source URL- Returns:
- if successful encoded textual diagram source from URL; otherwise empty string
- Throws:
IOException- if an input or output exception occurred
-