Package org.zkoss.web.util.resource

Examples of org.zkoss.web.util.resource.ServletContextLocator


   * @since 2.4.1
   */
  public ServletDspContext(ServletContext ctx,
  HttpServletRequest request, HttpServletResponse response,
  Writer out, Locator locator) {
    _locator = locator != null ? locator: new ServletContextLocator(ctx);
    _ctx = ctx;
    _request = request;
    _response = response;
    _out = out;
  }
View Full Code Here


    //load /WEB-INF/zk.xml
    try {
      final URL cfgUrl = _ctx.getResource("/WEB-INF/zk.xml");
      if (cfgUrl != null)
        parser.parse(cfgUrl, config, new ServletContextLocator(_ctx));
    } catch (Throwable ex) {
      log.error("Unable to load /WEB-INF/zk.xml", ex);
    }

    //after zk.xml is loaded since it depends on the configuration
    _cwr = ClassWebResource.getInstance(_ctx, _updateURI);
    _cwr.setCompress(new String[] {"js", "css", "html", "xml"});
    String s = Library.getProperty("org.zkoss.web.util.resource.dir");
    if (s != null && s.length() > 0) {
      if (s.charAt(0) != '/') s = '/' + s;
      _cwr.setExtraLocator(new ServletContextLocator(_ctx, null, s));
    }

    Labels.register(new ServletLabelLocator(_ctx));
    Labels.setVariableResolver(new ServletLabelResovler());
View Full Code Here

      final Execution exec = Executions.getCurrent();
      if (exec != null) path = exec.getDesktop().getCurrentDirectory();
    }
    final Object ctx = wapp.getNativeContext();
    if (ctx instanceof ServletContext)
      return new ServletContextLocator((ServletContext)ctx, path);
    throw new UnsupportedOperationException("Unknown context: "+ctx);
  }
View Full Code Here

    String uri = (String)map.get(index);
    if (uri == null) {
      final Locators.URLLocation loc =
        Locators.locate(pgpath, locale,
          locator != null ? locator: new ServletContextLocator(ctx));
      uri = loc != null ? loc.file: pgpath;
      map.put(index, uri);
    }

    return qstr != null ? uri + qstr: uri;
View Full Code Here

      final URL url = _ctx.getResource(configURI);
      if (url == null) {
        _config = null;
        log.info("File not found: "+ configURI);
      } else {
        _config = parser.parse(url, new ServletContextLocator(_ctx));
      }
    } catch (Throwable ex) {
      throw ZestException.Aide.wrap(ex, "Unable to load " + configURI);
    }
  }
View Full Code Here

TOP

Related Classes of org.zkoss.web.util.resource.ServletContextLocator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.