psdi.webclient.system.filter

Class HttpRequestModifyWrapper

  • java.lang.Object
    • javax.servlet.ServletRequestWrapper
      • javax.servlet.http.HttpServletRequestWrapper
        • psdi.webclient.system.filter.HttpRequestModifyWrapper
  • All Implemented Interfaces:
    javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest


    public final class HttpRequestModifyWrapper
    extends javax.servlet.http.HttpServletRequestWrapper
    Provides a convenient implementation of the HttpServletRequest interface that can be subclassed by developers wishing to adapt the request to a Servlet. This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped request object.
    • Field Summary

      • Fields inherited from interface javax.servlet.http.HttpServletRequest

        BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
    • Constructor Summary

      Constructors 
      Constructor and Description
      HttpRequestModifyWrapper(javax.servlet.http.HttpServletRequest servletRequest)
      Build the hashmap for init param and Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getParameter(java.lang.String parameter)
      Returns the value of a request parameter as a String, or null if the parameter does not exist.
      java.lang.String[] getParameterValues(java.lang.String parameter)
      Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
      java.lang.String securitySafeWithHTMLEncoding(java.lang.String aText)
      Returns the cross site vulnerability safe value of a request parameter
      • Methods inherited from class javax.servlet.http.HttpServletRequestWrapper

        getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
      • Methods inherited from class javax.servlet.ServletRequestWrapper

        getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameterMap, getParameterNames, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.servlet.ServletRequest

        getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameterMap, getParameterNames, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
    • Constructor Detail

      • HttpRequestModifyWrapper

        public HttpRequestModifyWrapper(javax.servlet.http.HttpServletRequest servletRequest)
        Build the hashmap for init param and Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist. If the parameter has a single value, the array has a length of 1.
        Parameters:
        a - String containing the name of the parameter whose value is requested
    • Method Detail

      • getParameterValues

        public java.lang.String[] getParameterValues(java.lang.String parameter)
        Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist. If the parameter has a single value, the array has a length of 1.
        Specified by:
        getParameterValues in interface javax.servlet.ServletRequest
        Overrides:
        getParameterValues in class javax.servlet.ServletRequestWrapper
        Parameters:
        name - a String containing the name of the parameter whose value is requested
        Returns:
        an array of String objects containing the parameter's values
      • getParameter

        public java.lang.String getParameter(java.lang.String parameter)
        Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request. For HTTP servlets, parameters are contained in the query string or posted form data. You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use getParameterValues(java.lang.String). If you use this method with a multivalued parameter, the value returned is equal to the first value in the array returned by getParameterValues. If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via getInputStream() or getReader() can interfere with the execution of this method.
        Specified by:
        getParameter in interface javax.servlet.ServletRequest
        Overrides:
        getParameter in class javax.servlet.ServletRequestWrapper
        Parameters:
        name - a String specifying the name of the parameter
        Returns:
        a String representing the single value of the parameter
      • securitySafeWithHTMLEncoding

        public java.lang.String securitySafeWithHTMLEncoding(java.lang.String aText)
        Returns the cross site vulnerability safe value of a request parameter
        Parameters:
        aText - a String specifying the value to check
        Returns:
        a String representing the safe value based on cross site vulnerability