Interface Request

    • Field Detail

      • REQUEST_PARSED

        static final String REQUEST_PARSED
        request-attribute to store a parsed HttpServletRequest in
    • Method Detail

      • process

        void process​(javax.servlet.http.HttpServletRequest httpServletRequest)
        Processes the given HttpServletRequest. Must only be called once per HttpServletRequest.
        Parameters:
        httpServletRequest - the HttpServletRequest to process
      • getHttpServletRequest

        javax.servlet.http.HttpServletRequest getHttpServletRequest()
        Returns the previously processed HttpServletRequest
        Returns:
        the HttpServletRequest
      • getEncoding

        String getEncoding()
        Return the encoding for this request
        Returns:
        the encoding
      • setEncoding

        void setEncoding​(String encoding)
        Sets the encoding for this request
        Parameters:
        encoding - the encoding
      • isMultiPart

        boolean isMultiPart()
        Returns true if this is a multipart request.
        Returns:
        true if this is a multipart request, false otherwise
      • isPost

        boolean isPost()
        Returns true if this is a HTPP POST request.
        Returns:
        true if this is a HTPP POST request, false otherwise
      • isGet

        boolean isGet()
        Returns true if this is a HTPP GET request.
        Returns:
        true if this is a HTPP GET request, false otherwise
      • setTempDir

        void setTempDir​(File tempDir)
        Sets the (absolute) temporary directory for storing FormUploads. Note that, if not set or not existent, the directory specified by the System propertey java.io.tmpdir is used.
        Parameters:
        tempDir - the directory for storing FormUploads
      • setMaxSize

        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.
        Parameters:
        maxSize - the maximum size of a FormUpload
        strict - if set to true, and a FormUpload exceeds the given size, the whole Request will be marked as invalid.
        See Also:
        isValid()
      • setAcceptedTypes

        void setAcceptedTypes​(String uploadName,
                              String... types)
        Sets the accepted mime-types or filetype-extensions for the given field
        Parameters:
        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 combination
      • getAcceptedTypes

        List<String> getAcceptedTypes​(String uploadName)
        Returns the accepted file-extensions/content-types for the input field with the given name.
        Parameters:
        uploadName - the name of the input field
        Returns:
        a list of accepted tyes
        See Also:
        FormUpload.getAcceptedTypes()
      • addParameters

        void addParameters​(Map<String,​String> parameters)
        Adds the given parameters to this 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:
        parameters - the parameters to add
        See Also:
        addParameter(String, String), RequestContainer.getParameter(String)
      • addParameter

        void addParameter​(String key,
                          String value)
        Adds the given parameter to this Request, but only if such a parameter not already exists. This prevents overwriting a parameter which is already present in the original HttpServletRequest.
        Parameters:
        key - the parameter name
        value - the parameter value