Class WebProxy.HttpRequest

  • All Implemented Interfaces:
    Request
    Enclosing class:
    WebProxy

    public static class WebProxy.HttpRequest
    extends Object
    implements Request
    A wrapper around the Jetty HttpRequest, giving the simple Request interface used in our URIResolvers. Gives access to URI and posted parameters.
    • Constructor Detail

      • HttpRequest

        protected HttpRequest​(javax.servlet.http.HttpServletRequest htReq)
        Constructs a new HttpRequest based on the given Jetty request.
        Parameters:
        htReq - A request object to wrap.
    • Method Detail

      • getURI

        public URI getURI()
        Get the URI from this request. In contrast to javax.servlet.HttpServletResponse this includes the query string.
        Specified by:
        getURI in interface Request
        Returns:
        The URI from this request.
        Throws:
        IOFailure - if the URI is invalid. This should never happen.
      • uriEncode

        public static String uriEncode​(String s)
        We here replace what should be standard API functionality with an apparent kludge. We do this because the constructor java.net.URI(String s) violates its own documentation. It should encode all "other" characters in the query part of the URI. These "other" characters include curly brackets, but actually the escaping is never done. Hence we do it here.
        Parameters:
        s - the String to be encoded
        Returns:
        the encoded String
      • getParameterMap

        public Map<String,​String[]> getParameterMap()
        Get parameters from this request. Note that this method is invalidated when the request is replied to.
        Specified by:
        getParameterMap in interface Request
        Returns:
        The parameters from this request.