code: private void doResource(HttpServletRequest req, HttpServletResponse resp) throws IOException
    {
      boolean success = true;
      String resource = (String) req.getParameter("id");
      if (!isEmpty(resource))
      {
        if (resource.endsWith(".js"))
        {
          resp.setContentType("text/javascript");
        } else if (resource.endsWith(".css"))
        {
          resp.setContentType("text/css");
        } else if (resource.endsWith(".html"))
        {
          resp.setContentType("text/html");
        } else
        {
          resp.setContentType("text/plain");
        }
  
        String contents = resourceLoader.getResource(resource, resourceReplacements);
        if (contents != null)
        {
          if (resourceCacheHours > 0)
          {
            Calendar c = Calendar.getInstance();
            c.add(Calendar.HOUR, resourceCacheHours);
            resp.setHeader("Cache-Control", "public, must-revalidate");
            resp.setHeader("Expires", new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz").format(c.getTime()));
          } else
          {
            resp.setHeader("Cache-Control", "no-cache");
          }
  
          PrintWriter w = resp.getWriter();
          w.print(contents);
        } else
        {
          success = false;
        }
      }
      if (!success)
      {
        resp.sendError(404);
      }
    }
docs: Serve one of the static resources for the profiler UI.