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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AsciiCoderServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
protected void
doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
protected String
getEncodedTextFromUrl(jakarta.servlet.http.HttpServletRequest request)
Get encoded textual diagram source from URL.protected String
getServletContextPath()
Context path from the servlet mapping URL pattern.protected net.sourceforge.plantuml.code.Transcoder
getTranscoder()
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:
doGet
in classjakarta.servlet.http.HttpServlet
- Throws:
IOException
jakarta.servlet.ServletException
-
doPost
protected void doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException
- Overrides:
doPost
in classjakarta.servlet.http.HttpServlet
- Throws:
jakarta.servlet.ServletException
IOException
-
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
-
-