code: public static String getServletPath(HttpServletRequest request) {
      String servletPath = request.getServletPath();
      if (Strings.isNotEmpty(servletPath)) {
        return servletPath;
      } else {
        String uri = request.getRequestURI();
        if (uri.length() == 1) return "";
        // process context
        String context = request.getContextPath();
        int length = context.length();
        if (length > 2) {
          if ('/' == context.charAt(length - 1)) context = context.substring(0, length - 1);
          return servletPath = uri.substring(context.length());
        } else {
          return uri;
        }
      }
    }
docs: Return the true servlet path. When servletPath provided by container is
  empty,It will return requestURI'
  <p>
  查找当前调用的action对应的.do<br>
  例如http://localhost/myapp/dd.do 返回/dd.do<br>
  http://localhost/myapp/dir/to/dd.do 返回/dir/to/dd.do