Class RequestUtil

  • public final class RequestUtil
    extends java.lang.Object
    General purpose request parsing and encoding utility methods.
    Craig R. McClanahan, Tim Tye
    • Constructor Detail

      • RequestUtil

        public RequestUtil()
    • Method Detail

      • getRequestURL

        public static java.lang.StringBuffer getRequestURL​(HttpServletRequest request)
        Build an appropriate return value for HttpServletRequest.getRequestURL() based on the provided request object. Note that this will also work for instances of HttpServletRequestWrapper.
        request - The request object for which the URL should be built
        The request URL for the given request object
      • filter

        public static java.lang.String filter​(java.lang.String message)
        This method will be removed in Tomcat 9
        Filter the specified message string for characters that are sensitive in HTML. This avoids potential attacks caused by including JavaScript codes in the request URL that is often reported in error messages.
        message - The message string to be filtered
        the filtered message