Get full URL and query string in Servlet for both HTTP and HTTPS requests
By design, getRequestURL() gives you the full URL, missing only the query string. In HttpServletRequest, you can get individual parts of the URI using the methods below: // Example: http://myhost:8080/people?lastname=Fox&age=30 String uri = request.getScheme() + “://” + // “http” + “:// request.getServerName() + // “myhost” “:” + // “:” request.getServerPort() + // “8080” request.getRequestURI() + … Read more