Package org.zkoss.web.util.resource

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


   * @since 5.0.3
   */
  public static void updateDebugJS(WebApp wapp, boolean debug) {
    final WebManager wm = WebManager.getWebManagerIfAny(wapp);
    if (wm != null) {
      final ClassWebResource cwr = wm.getClassWebResource();
      cwr.setDebugJS(debug);
      final Extendlet ext = cwr.getExtendlet("wpd");
      if (ext instanceof WpdExtendlet)
        ((WpdExtendlet)ext).setDebugJS(debug);
    }
  }
View Full Code Here


    //Bug 1801028: We cannot invoke ZumlExtendlet directly
    //The real reason is unknown yet -- it could be due to
    //the re-creation of ExecutionImpl
    //However, the performance is not a major issue, so just skip
    final ClassWebResource cwr =
      WebManager.getWebManager(_ctx).getClassWebResource();
    final String attrnm = include ?
      "org.zkoss.web.servlet.include": "org.zkoss.web.servlet.forward";
    if (isDirectInclude(cwr, page)) {
      Object old = null;
      if (mode == PASS_THRU_ATTR) {
        old = _request.getAttribute(Attributes.ARG);
        if (params != null)
          _request.setAttribute(Attributes.ARG, params);
          //If params=null, use the 'inherited' one (same as Servlets.include)
      }

      _request.setAttribute(attrnm, Boolean.TRUE);
        //so Servlets.isIncluded returns correctly
      try {
        cwr.service(_request,
          HttpBufferedResponse.getInstance(_response, out),
          page.substring(2));
      } finally {
        _request.removeAttribute(attrnm);
        if (mode == PASS_THRU_ATTR)
View Full Code Here

    final boolean withpi = pi != null && pi.length() != 0;
    if (withpi && pi.startsWith(ClassWebResource.PATH_PREFIX)) {
      //use HttpSession to avoid loading SerializableSession in GAE
      //and don't retrieve session if possible
      final ClassWebResource cwr = getClassWebResource();
      final HttpSession hsess =
        shallSession(cwr, pi) ? request.getSession(false): null;
      Object oldsess = null;
      if (hsess == null) {
        oldsess = SessionsCtrl.getRawCurrent();
        SessionsCtrl.setCurrent(new SessionResolverImpl(_ctx, request));
        //it might be created later
      }

      WebApp wapp;
      Session sess;
      final Object old = hsess != null?
        (wapp = WebManager.getWebAppIfAny(_ctx)) != null &&
        (sess = SessionsCtrl.getSession(wapp, hsess)) != null ?
          I18Ns.setup(sess, request, response, "UTF-8"):
          I18Ns.setup(hsess, request, response, "UTF-8"):
        Charsets.setup(null, request, response, "UTF-8");
      try {
        cwr.service(request, response,
            pi.substring(ClassWebResource.PATH_PREFIX.length()));
      } finally {
        if (hsess != null) I18Ns.cleanup(request, old);
        else {
          Charsets.cleanup(request, old);
View Full Code Here

TOP

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

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.