code: public static String[] getPathComponents(String requestURI, String servletPath)
    {
      ArrayList<String> tokens = new ArrayList<String>();
  
      if (requestURI != null && servletPath != null && servletPath.length() > 0)
      {
        int servletPathStartPos = requestURI.indexOf(servletPath);
        if (servletPathStartPos != -1)
        {
          String components = requestURI.substring(servletPathStartPos + servletPath.length());
          StringTokenizer st = new StringTokenizer(components, "/");
          while (st.hasMoreTokens())
          {
            tokens.add(urlDecode(st.nextToken()));
          }
        }
      }
  
      return tokens.toArray(new String[tokens.size()]);
    }
docs: Returns an array of the '/' delimited components for a URL path, starting
  just after the servlet path. For example, if requestURI is leo/a/b/c/d/
  and servletPath is /a, then the array returned will be {b,c,d}. The path
  components are returned decoded (not htmlified)
  @param requestURI request URI (obtained via request.getRequestURI())
  @param servletPath servlet path (obtained via request.getServletPath())
  @return an array of the components in the URI, starting just after the
  specified servletPath.