code: public static String getContext(final HttpServletRequest request) {
      String context = request.getContextPath();
      if ((context == null) || (context.equals("."))) {
        context = "";
      }
  
      return context;
    }
docs: Returns the context path.
  <p>For example, a URL of http://myhost.com:8080/myapp/doit.do will get a
  result "/myapp"
  
  <p>Note: do we have to deal with MultipartRequestWrapper?
  
  @param request
  @return context path