public Path getContentPath(HttpServletRequest req) {
    String uri=req.getRequestURI(),
           contentPath=null;
    try {
      contentPath=uri.substring(req.getContextPath().length());
    } catch (Exception e) {
      throw new InternalException(
        "Something went wrong with getRequestURI()="+uri+" getContextPath()="+req.getContextPath(), 
        e
      );
    }
    Log.fine("***********");
    Log.info("ContentViewer", "getContentPath()", contentPath);
    if (contentPath.indexOf("..")>-1 || !contentPath.startsWith("/")) {
      Log.info("ContentViewer", "getContentPath()", contentPath, "ILLEGAL CONTENT PATH");
      return null;
    }
    if (contentPath.endsWith("/"))
      contentPath+="index.html";
    return new Path(contentPath);
  }