Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.yammer.dropwizard.util;
 
Utility functions for dealing with servlets.
 
 public class Servlets {
     private Servlets() { /* singleton */ }

    
Returns the full URL of the given request.

Parameters:
request an HTTP servlet request
Returns:
the full URL, including the query string
    public static String getFullUrl(HttpServletRequest request) {
        final StringBuilder url = new StringBuilder(100).append(request.getRequestURI());
        if (request.getQueryString() != null) {
            url.append('?').append(request.getQueryString());
        }
        return url.toString();
    }
New to GrepCode? Check out our FAQ X