public static boolean matchesUrl(final HttpServletRequest request,final String path){
  final Pattern pattern=Pattern.compile(".*" + path + "[/]?",Pattern.CASE_INSENSITIVE);
  if (request.getRequestURI() != null) {
    final Matcher m=pattern.matcher(request.getRequestURI());
    return m.matches();
  }
  return false;
}

public static boolean matchesUrl ( final HttpServletRequest request , final String path ) { final Pattern pattern = Pattern . compile ( ".*" + path + "[/]?" , Pattern . CASE_INSENSITIVE ) ; if ( request . getRequestURI ( ) != null ) { final Matcher m = pattern . matcher ( request . getRequestURI ( ) ) ; return m . matches ( ) ; } return false ; }
utility used to verify that requesturi matches provided path
