So I\'m trying to grab the current URL of the page using Java\'s request object. I\'ve been using request.getRequestURI() to preform this, but I noticed that when a java cla
To get the HTTP requested path without know the state of the internal flow of the request, use this method:
public String getUri(HttpServletRequest request) { String r = (String) request.getAttribute("javax.servlet.forward.request_uri"); return r == null ? request.getRequestURI() : r; }