Class UploadServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
de.businesscode.bcdui.upload.data.UploadServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
public class UploadServlet
extends jakarta.servlet.http.HttpServlet
Entry point for all data data upload related steps, supports POST and PUT
Add custom steps in web.xml in the following format:
<init-param>
<param-name>Steps</param-name>
<param-value>
MY_STEP_NAME: de.my.package.ClassName;
MY_STEP_NAME2: de.my.package.ClassName2;
</param-value>
</init-param -->
Such Steps
- need a Constructor getting (UploadControl uc, String userId)
- implement IUploadStep
- if writing, call UploadControl#addStepResult() at the end of their process()
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected Map<String,
Class<? extends IUploadStep>> Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Connection
protected String
getMultipartParam
(jakarta.servlet.http.Part part, String paramName) Retrieve the filename of the data upload file from http headerstatic String
getTransformSQL
(String sql) protected String
void
init()
protected void
service
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Receives an data upload file and creates an entry in bcd_dataupload_controlMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, init, isSensitiveHeader, service
Methods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
-
Field Details
-
PARAM_NAME_UPLOADID
- See Also:
-
PARAM_NAME_STEPS
- See Also:
-
PARAM_NAME_TARGETBS
- See Also:
-
PARAM_NAME_DELETE
- See Also:
-
PARAM_STEPS_SEPARATOR
- See Also:
-
INIT_PARAM_STEPS
- See Also:
-
PART_FILENAME
- See Also:
-
PARAM_NAME_FILENAME
- See Also:
-
ANONYMOUS_ID
- See Also:
-
stepImpls
-
-
Constructor Details
-
UploadServlet
public UploadServlet()
-
-
Method Details
-
service
protected void service(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException Receives an data upload file and creates an entry in bcd_dataupload_control- Overrides:
service
in classjakarta.servlet.http.HttpServlet
- Parameters:
request
-response
-- Throws:
jakarta.servlet.ServletException
-
getUserId
- Returns:
- userId (or a predefined string
ANONYMOUS_ID
) if no user is known
-
getMultipartParam
Retrieve the filename of the data upload file from http header- Parameters:
part
-paramName
-- Returns:
-
init
public void init() throws jakarta.servlet.ServletException- Overrides:
init
in classjakarta.servlet.GenericServlet
- Throws:
jakarta.servlet.ServletException
-
getTransformSQL
-
getControlConnection
- Throws:
Exception
-