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.HttpServletASCII encoder and decoder servlet for the webapp. This servlet encodes the diagram in text format or decodes the compressed diagram string.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AsciiCoderServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoGet(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 StringgetServletContextPath()Context path from the servlet mapping URL pattern.protected net.sourceforge.plantuml.code.TranscodergetTranscoder()Get PlantUML transcoder.-
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Method Detail
-
getServletContextPath
protected String 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
-
-