public interface Request extends RequestContainer
RequestContainer and allows processing a HttpServletRequest by
calling process(HttpServletRequest).| Modifier and Type | Field and Description |
|---|---|
static String |
REQUEST_PARSED
request-attribute to store a parsed
HttpServletRequest in |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(String name,
String value)
Adds the given parameter to this
Request, but only if such a parameter not already exists. |
void |
addParameters(Map<String,String> parameters)
Adds the given parameters to this
Request, but only for those parameters not already existsing. |
void |
addParameters(String name,
List<String> values)
Adds the given parameters to this
Request, but only if such a parameter not already exists. |
List<String> |
getAcceptedTypes(String uploadName)
Returns the accepted file-extensions/content-types for the input field with the given name.
|
String |
getEncoding()
Return the encoding for this request
|
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Returns the previously processed
HttpServletRequest |
boolean |
isGet()
Returns
true if this is a HTPP GET request. |
boolean |
isMultiPart()
Returns
true if this is a multipart request. |
boolean |
isPost()
Returns
true if this is a HTPP POST request. |
boolean |
isValid()
Checks whether this is a valid
Request, i.e. |
void |
process(javax.servlet.http.HttpServletRequest httpServletRequest)
Processes the given
HttpServletRequest. |
void |
setAcceptedTypes(String uploadName,
String... types)
Sets the accepted mime-types or filetype-extensions for the given field
|
void |
setEncoding(String encoding)
Sets the encoding for this request
|
void |
setMaxSize(long maxSize)
Sets the maximum size for a
FormUpload within this Request. |
void |
setMaxSize(long maxSize,
boolean strict)
Sets the maximum size for a
FormUpload within this Request, and additionally defines if
violations should be handled strict. |
void |
setTempDir(File tempDir)
Sets the (absolute) temporary directory for storing
FormUploads. |
getFormUploads, getFormUploads, getHost, getParameter, getParameterList, getParameterNames, getParameters, getParametersList, hasParameterstatic final String REQUEST_PARSED
HttpServletRequest invoid process(javax.servlet.http.HttpServletRequest httpServletRequest)
HttpServletRequest. Must only be called once per HttpServletRequest.httpServletRequest - the HttpServletRequest to processjavax.servlet.http.HttpServletRequest getHttpServletRequest()
HttpServletRequestHttpServletRequestString getEncoding()
void setEncoding(String encoding)
encoding - the encodingboolean isMultiPart()
true if this is a multipart request.true if this is a multipart request, false otherwiseboolean isPost()
true if this is a HTPP POST request.true if this is a HTPP POST request, false otherwiseboolean isGet()
true if this is a HTPP GET request.true if this is a HTPP GET request, false otherwiseboolean isValid()
Request, i.e. no Exception occurred during
process(HttpServletRequest).true if this Request is valid, false otherwisevoid setTempDir(File tempDir)
FormUploads. Note that, if not set or not existent,
the directory specified by the System propertey java.io.tmpdir is used.tempDir - the directory for storing FormUploadsvoid setMaxSize(long maxSize)
FormUpload within this Request.maxSize - the maximum size of a FormUploadFormUpload.getMaxSize()void setMaxSize(long maxSize,
boolean strict)
FormUpload within this Request, and additionally defines if
violations should be handled strict.maxSize - the maximum size of a FormUploadstrict - if set to true, and a FormUpload exceeds the given size, the whole Request
will be marked as invalid.isValid()void setAcceptedTypes(String uploadName, String... types)
uploadName - the name of the input-field (type="file")types - the accepted mimetypes (e.g. image/jpeg, image/png) or file extensions (e.g jgp,png), those can
be used in combinationList<String> getAcceptedTypes(String uploadName)
uploadName - the name of the input fieldFormUpload.getAcceptedTypes()void addParameters(Map<String,String> parameters)
Request, but only for those parameters not already existsing. This
prevents overwriting a parameter which is already present in the original HttpServletRequest. The given
Map uses the parameter name as the key and the parameter value as the value.parameters - the parameters to addaddParameter(String, String),
RequestContainer.getParameter(String)void addParameter(String name, String value)
Request, but only if such a parameter not already exists. This prevents
overwriting a parameter which is already present in the original HttpServletRequest.name - the parameter namevalue - the parameter valuevoid addParameters(String name, List<String> values)
Request, but only if such a parameter not already exists. This prevents
overwriting a parameter which is already present in the original HttpServletRequest.name - the parameter namevalues - the parameter valuesCopyright © 2011–2023 aiticon GmbH. All rights reserved.