/** * Switches between getRequestLocationIncludingQueryParameter and * getRequestLocationIncludingParameter based on the * consumeFORMURLEncodedBody flag. */ public static String getRequestLocationIncludingParameter(final HttpServletRequest request, boolean consumeFORMURLEncodedBody) { if (!consumeFORMURLEncodedBody || "GET".equals(request.getMethod())) { return getRequestLocationIncludingQueryParameter(request); } if (mayContainRequestParameter(request)) { StringBuilder currentRequestLocation = new StringBuilder(getRequestLocation(request)); appendRequestParameter(currentRequestLocation, request); return currentRequestLocation.toString(); } return getRequestLocationIncludingQueryParameter(request); }
public String getRequestLocation() { return ServletUtils.getRequestLocation(getRequest()); }