Code example for HttpRequest

Methods: getRequestLine

0
 
    /** 
     * Extracts request path from the given {@link HttpRequest} 
     */ 
    protected String getRequestPath(final HttpRequest request) {
        String uriPath = request.getRequestLine().getUri();
        int index = uriPath.indexOf("?");
        if (index != -1) {
            uriPath = uriPath.substring(0, index);
        } else { 
            index = uriPath.indexOf("#");
            if (index != -1) {
                uriPath = uriPath.substring(0, index);
            } 
        } 
        return uriPath;
    } 
 
    /** 
     * Looks up a handler matching the given request URI. 
     * 
     * @param request the request 
     * @return handler or <code>null</code> if no match is found. 
     */ 
    public HttpRequestHandler lookup(final HttpRequest request) {
        Args.notNull(request, "HTTP request");
        return matcher.lookup(getRequestPath(request));
    } 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java