Class TextToUrl

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
de.businesscode.bcdui.toolbox.TextToUrl
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

public class TextToUrl extends jakarta.servlet.http.HttpServlet
This servlet allows POSTing a text and retrieve it (up to 24h) later via GET under a given name Each servlet instance has its only scope name. Use for example <servlet> <servlet-name>SldToUrl</servlet-name> <servlet-class>de.businesscode.bcdui.toolbox.TextToUrl</servlet-class> <init-param><param-name>SCOPE</param-name> <param-value>sld</param-value></init-param> <init-param><param-name>NAME_TEMPLATE</param-name> <param-value>sld%d.xml</param-value></init-param> <init-param><param-name>DATA_SOURCE</param-name> <param-value>jdbc/datasourceName</param-value></init-param> <init-param><param-name>TABLE</param-name> <param-value>tableName</param-value></init-param> <init-param><param-name>MIME_TYPE</param-name> <param-value>text/xml</param-value></init-param> </servlet> to initialize the servlet. Table needs to have the form CREATE TABLE tablename ( name VARCHAR(64), value CLOB, scope VARCHAR(32), ts TIMESTAMP ) ; For parameters > 4000 character Oracle requires connectionProperties="SetBigStringTryClob=true" (for example in Tomcat DataSource Resource definition)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected DataSource
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected static final String
     
    protected String
     
    protected String
     
    protected String
     
    protected String
     
    protected String
     

    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 req, jakarta.servlet.http.HttpServletResponse resp)
     
    void
    doPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
     
    void
    init(jakarta.servlet.ServletConfig config)
     

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doHead, doOptions, doPatch, doPut, doTrace, getLastModified, 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
  • Field Details

  • Constructor Details

    • TextToUrl

      public TextToUrl()
  • Method Details

    • doPost

      public void doPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws jakarta.servlet.ServletException, IOException
      Overrides:
      doPost in class jakarta.servlet.http.HttpServlet
      Throws:
      jakarta.servlet.ServletException
      IOException
    • doGet

      public void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws jakarta.servlet.ServletException, IOException
      Overrides:
      doGet in class jakarta.servlet.http.HttpServlet
      Throws:
      jakarta.servlet.ServletException
      IOException
    • init

      public void init(jakarta.servlet.ServletConfig config) throws jakarta.servlet.ServletException
      Specified by:
      init in interface jakarta.servlet.Servlet
      Overrides:
      init in class jakarta.servlet.http.HttpServlet
      Throws:
      jakarta.servlet.ServletException