Package de.businesscode.bcdui.toolbox
Class TextToUrl
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- de.businesscode.bcdui.toolbox.TextToUrl
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class TextToUrl extends javax.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.sql.DataSource
ds
protected static java.lang.String
INIT_DATASOURCE_TOKEN
protected static java.lang.String
INIT_MIME_TYPE
protected static java.lang.String
INIT_NAME_TEMPLATE
protected static java.lang.String
INIT_SCOPE
protected static java.lang.String
INIT_TABLE_TOKEN
protected java.lang.String
mimeType
protected java.lang.String
nameTemplate
protected java.lang.String
stmtClean
protected java.lang.String
stmtRead
protected java.lang.String
stmtWrite
-
Constructor Summary
Constructors Constructor Description TextToUrl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
void
doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
void
init(javax.servlet.ServletConfig config)
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
INIT_SCOPE
protected static final java.lang.String INIT_SCOPE
- See Also:
- Constant Field Values
-
INIT_NAME_TEMPLATE
protected static final java.lang.String INIT_NAME_TEMPLATE
- See Also:
- Constant Field Values
-
INIT_DATASOURCE_TOKEN
protected static final java.lang.String INIT_DATASOURCE_TOKEN
- See Also:
- Constant Field Values
-
INIT_TABLE_TOKEN
protected static final java.lang.String INIT_TABLE_TOKEN
- See Also:
- Constant Field Values
-
INIT_MIME_TYPE
protected static final java.lang.String INIT_MIME_TYPE
- See Also:
- Constant Field Values
-
mimeType
protected java.lang.String mimeType
-
stmtWrite
protected java.lang.String stmtWrite
-
stmtRead
protected java.lang.String stmtRead
-
stmtClean
protected java.lang.String stmtClean
-
nameTemplate
protected java.lang.String nameTemplate
-
ds
protected javax.sql.DataSource ds
-
-
Method Detail
-
doPost
public void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
- Overrides:
doPost
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
java.io.IOException
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
java.io.IOException
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
- Specified by:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in classjavax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
-
-