code: static String requestURI(HttpServletRequest request)
     {
        String uri = request.getRequestURI();
        if (uri != null)
        {
           String contextPath = request.getContextPath();
           int length = contextPath == null ? 0 : contextPath.length();
           if (length > 0)
           {
              uri = uri.substring(length);
           }
           if (uri.equals("/"))
           {
              uri = "";
           }
        }
        else
        {
           uri = "";
        }
        
        // according to the JACC specification, all colons within the request URI must be escaped.
        if (uri.indexOf(':') > 0)
           uri = uri.replaceAll(":", ENCODED_COLON);
        return uri;
     }
docs: <p>
  Build a permission name from the substring of the {@code HttpServletRequest.getRequestURI()}) that begins after
  the contextPath ({@code HttpServletRequest.getContextPath()}). When the substring operation yields the string "/",
  the permission is constructed with the empty string as its name.
  </p>
  
  @param request
  - the Servlet request object.
  @return the resource permission name.