Class RequestBean

    • Constructor Detail

      • RequestBean

        public RequestBean()
      • RequestBean

        public RequestBean​(long maxSize)
      • RequestBean

        public RequestBean​(long maxSize,
                           File tempDir)
    • Method Detail

      • process

        public void process​(javax.servlet.http.HttpServletRequest servletRequest)
        Description copied from interface: Request
        Processes the given HttpServletRequest. Must only be called once per HttpServletRequest.
        Specified by:
        process in interface Request
        Parameters:
        servletRequest - the HttpServletRequest to process
      • getEncoding

        public String getEncoding()
        Description copied from interface: Request
        Return the encoding for this request
        Specified by:
        getEncoding in interface Request
        Returns:
        the encoding
      • setEncoding

        public void setEncoding​(String encoding)
        Description copied from interface: Request
        Sets the encoding for this request
        Specified by:
        setEncoding in interface Request
        Parameters:
        encoding - the encoding
      • isMultiPart

        public boolean isMultiPart()
        Description copied from interface: Request
        Returns true if this is a multipart request.
        Specified by:
        isMultiPart in interface Request
        Returns:
        true if this is a multipart request, false otherwise
      • isPost

        public boolean isPost()
        Description copied from interface: Request
        Returns true if this is a HTPP POST request.
        Specified by:
        isPost in interface Request
        Returns:
        true if this is a HTPP POST request, false otherwise
      • isGet

        public boolean isGet()
        Description copied from interface: Request
        Returns true if this is a HTPP GET request.
        Specified by:
        isGet in interface Request
        Returns:
        true if this is a HTPP GET request, false otherwise
      • setTempDir

        public void setTempDir​(File tempDir)
        Description copied from interface: Request
        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.
        Specified by:
        setTempDir in interface Request
        Parameters:
        tempDir - the directory for storing FormUploads
      • setMaxSize

        public void setMaxSize​(long maxSize,
                               boolean isStrict)
        Description copied from interface: Request
        Sets the maximum size for a FormUpload within this Request, and additionally defines if violations should be handled strict.
        Specified by:
        setMaxSize in interface Request
        Parameters:
        maxSize - the maximum size of a FormUpload
        isStrict - if set to true, and a FormUpload exceeds the given size, the whole Request will be marked as invalid.
        See Also:
        Request.isValid()
      • setAcceptedTypes

        public void setAcceptedTypes​(String uploadName,
                                     String... types)
        Description copied from interface: Request
        Sets the accepted mime-types or filetype-extensions for the given field
        Specified by:
        setAcceptedTypes in interface Request
        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

        public List<String> getAcceptedTypes​(String uploadName)
        Description copied from interface: Request
        Returns the accepted file-extensions/content-types for the input field with the given name.
        Specified by:
        getAcceptedTypes in interface Request
        Parameters:
        uploadName - the name of the input field
        Returns:
        a list of accepted tyes
        See Also:
        FormUpload.getAcceptedTypes()
      • getHttpServletRequest

        public javax.servlet.http.HttpServletRequest getHttpServletRequest()
        Description copied from interface: Request
        Returns the previously processed HttpServletRequest
        Specified by:
        getHttpServletRequest in interface Request
        Returns:
        the HttpServletRequest
      • addParameter

        public void addParameter​(String key,
                                 String value)
        Description copied from interface: Request
        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.
        Specified by:
        addParameter in interface Request
        Parameters:
        key - the parameter name
        value - the parameter value
      • getParameter

        public String getParameter​(String name)
        Description copied from interface: RequestContainer
        Returns the value for the parameter with the given name.
        Note that for a multi-valued parameter, any of the submitted values is returned. Use RequestContainer.getParameterList(String) instead if you want to deal with a multi-valued parameter.
        Specified by:
        getParameter in interface RequestContainer
        Parameters:
        name - the name of the parameter
        Returns:
        the value of the parameter (may be null)
      • getParameterList

        public List<String> getParameterList​(String name)
        Description copied from interface: RequestContainer
        Returns a List containing all the values for the parameter with the given name.
        Specified by:
        getParameterList in interface RequestContainer
        Parameters:
        name - the name of the parameter
        Returns:
        a List (never null, but may be empty) containing all the values for the given parameter
      • getParameters

        public Map<String,​String> getParameters()
        Description copied from interface: RequestContainer
        Returns an immutable Map containing the name of each request-parameter as a key and a single parameter value as the map's value.
        Note that for multi-valued parameters, the returned map contains any of the submitted values. Use RequestContainer.getParametersList() instead if you want to deal with multi-valued parameters.
        Specified by:
        getParameters in interface RequestContainer
        Returns:
        a Map containing the request parameters
      • getParametersList

        public Map<String,​List<String>> getParametersList()
        Description copied from interface: RequestContainer
        Returns an immutable Map containing the name of each request-parameter as a key and the list of submitted values as value.
        Specified by:
        getParametersList in interface RequestContainer
        Returns:
        a Map containing the request parameters (including multi-valued ones)
      • hasParameter

        public boolean hasParameter​(String name)
        Description copied from interface: RequestContainer
        Checks whether a parameter with the given name exists.
        Specified by:
        hasParameter in interface RequestContainer
        Parameters:
        name - the name of the parameter
        Returns:
        true if such a parameter exists, false otherwise
      • setHost

        public void setHost​(String host)
      • getXssUtil

        public XSSUtil getXssUtil()
      • setXssUtil

        public void setXssUtil​(XSSUtil xssUtil)