Esempio n. 1
0
  // called by Provider
  InputStream getResourceAsStream(HttpServletRequest request, String path, boolean locate)
      throws IOException, ServletException {
    if (locate)
      path = Servlets.locate(_webctx.getServletContext(), request, path, _webctx.getLocator());

    if (_cache.getCheckPeriod() >= 0) {
      // Due to Web server might cache the result, we use URL if possible
      try {
        URL url = _webctx.getResource(path);
        if (url != null) return url.openStream();
      } catch (Throwable ex) {
        log.warningBriefly("Unable to read from URL: " + path, ex);
      }
    }

    // Note: _webctx will handle the renaming for debugJS (.src.js)
    return _webctx.getResourceAsStream(path);
  }
Esempio n. 2
0
 ServletContext getServletContext() {
   return _webctx != null ? _webctx.getServletContext() : null;
 }
Esempio n. 3
0
 WebApp getWebApp() {
   return _webctx != null
       ? WebManager.getWebManager(_webctx.getServletContext()).getWebApp()
       : null;
 }