code: public String getContextPath() {
          ServletRequest request = pageContext.getRequest();
          if (request instanceof HttpServletRequest) {
              return ((HttpServletRequest) request).getContextPath();
          }
          return "/";
      }
docs: Gets the context path associated with the current JSP page request.
  If the request is not a HttpServletRequest, this method will
  return "/".
  
  @return a path relative to the current context's  root, or
  {@code "/"} if this is not a HTTP request.