public class WUploadSingle
extends javax.servlet.http.HttpServlet
Generic servlet that upload single file in multipath way with name from parameter named paramNameFileToUpload, then add pass attributes "fileToUploadInputStream"-"[InputStream]" and "fileToUploadName"-"[file name]" in "HttpRequestData" and delegate this requestData to a IHandlerRequest that can implements any business logic to handle this. fileToUploadInputStream should be closed by delegate. "paramNameFileToUpload" is name of filePath property of entity e.g. itsPath of entity Eattachment. Delete action required parameter nameFieldPath to retrieve path with reflection to delete uploaded file.
| Constructor and Description |
|---|
WUploadSingle() |
| Modifier and Type | Method and Description |
|---|---|
void |
doPost(javax.servlet.http.HttpServletRequest pReq,
javax.servlet.http.HttpServletResponse pResp) |
String |
getDirJsp()
Geter for dirJsp.
|
org.beigesoft.factory.IFactoryAppBeans |
getFactoryAppBeans()
Geter for factoryAppBeans.
|
String |
getSubmittedFileName(javax.servlet.http.Part pPart)
Retrieve file name from part.
|
void |
init() |
void |
setDirJsp(String pDirJsp)
Setter for dirJsp.
|
void |
setFactoryAppBeans(org.beigesoft.factory.IFactoryAppBeans pFactoryAppBeans)
Setter for factoryAppBeans.
|
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, servicepublic final void init()
throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic final void doPost(javax.servlet.http.HttpServletRequest pReq,
javax.servlet.http.HttpServletResponse pResp)
throws javax.servlet.ServletException,
IOException
doPost in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionpublic final String getSubmittedFileName(javax.servlet.http.Part pPart) throws Exception
Retrieve file name from part.
pPart - file dataException - - an exceptionpublic final org.beigesoft.factory.IFactoryAppBeans getFactoryAppBeans()
Geter for factoryAppBeans.
public final void setFactoryAppBeans(org.beigesoft.factory.IFactoryAppBeans pFactoryAppBeans)
Setter for factoryAppBeans.
pFactoryAppBeans - referencepublic final String getDirJsp()
Geter for dirJsp.
public final void setDirJsp(String pDirJsp)
Setter for dirJsp.
pDirJsp - referenceCopyright © 2016–2018. All rights reserved.