示例#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);
  }
示例#2
0
 ServletContext getServletContext() {
   return _webctx != null ? _webctx.getServletContext() : null;
 }
示例#3
0
 WebApp getWebApp() {
   return _webctx != null
       ? WebManager.getWebManager(_webctx.getServletContext()).getWebApp()
       : null;
 }
示例#4
0
 // called by Provider
 URL getResource(String path) throws IOException {
   return _webctx.getResource(path);
 }