public static final String getRequestUriWithoutContextPath ( HttpServletRequest request ) { String uri = request . getRequestURI ( ) . substring ( request . getContextPath ( ) . length ( ) ) ; if ( ! uri . isEmpty ( ) ) { return uri ; } else { return "/" ; } }
Returns the request URI without the context path .