Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.Session


  }

  public void service(HttpServletRequest request,
      HttpServletResponse response, String pi) throws ServletException,
      IOException {
    final Session sess = Sessions.getCurrent(false);
    if (sess == null) {
      response.setIntHeader("ZK-Error", HttpServletResponse.SC_GONE);
      return;
    }
    String type = request.getParameter("type");
    String dtid = request.getParameter("dtid");
    String uuid = request.getParameter("uuid");
    String url = request.getParameter("url");
   
    try {
     
      FileItem item = parseFileItem(request);
      url = FilebrowserController.getFolderUrl(url);
        String path = request.getContextPath() + url;
     
     
      if (item != null) {
        final Desktop desktop = ((WebAppCtrl)sess.getWebApp())
          .getDesktopCache(sess).getDesktopIfAny(dtid);
        CKeditor ckez = (CKeditor)desktop.getComponentByUuidIfAny(uuid);
        String nextURI = "~./ckez/html/fileupload-done.html.dsp";
        final Map attrs = new HashMap();
        attrs.put("CKEditorFuncNum", request.getParameter("CKEditorFuncNum"));
View Full Code Here


    if (request.getAttribute(ATTR_SETUP) != null) { //has been setup
      old = null;
    } else {
      final HttpSession hsess;
      if (sess instanceof Session) {
        final Session se = (Session)sess;
        //Invoke the request interceptors
        se.getWebApp().getConfiguration()
          .invokeRequestInterceptors(se, request, response);

        hsess = (HttpSession)se.getNativeSession();
      } else {
        hsess = (HttpSession)sess;
      }

      final Object ol = Charsets.setup(hsess, request, response, charset);
View Full Code Here

    return false; //not support ALLOW_DIRECT_INCLUDE
  }
  public void service(HttpServletRequest request,
  HttpServletResponse response, String path)
  throws ServletException, IOException {
    final Session sess = WebManager.getSession(getServletContext(), request);
    final PageDefinition pagedef = (PageDefinition)_cache.get(path);
    if (pagedef == null) {
      //FUTURE: support the error page (from Configuration)
      handleError(sess, request, response, path, null);
      return;
    }

    //mimic DHtmlLayoutServlet to process PageDefinition
    final Object old = I18Ns.setup(sess, request, response,
      sess.getWebApp().getConfiguration().getResponseCharset());
    try {
      process(sess, request, response, pagedef, path);
    } catch (Throwable ex) {
      handleError(sess, request, response, path, ex);
    } finally {
View Full Code Here

    } finally {
      _desktops.disableExpunge(oldexp);
    }
  }
  private static void desktopDestroyed(Desktop desktop) {
    final Session sess = desktop.getSession();
    final WebApp wapp = desktop.getWebApp();
    ((DesktopCtrl)desktop).invokeDesktopCleanups();
    final Configuration config = wapp.getConfiguration();
    config.invokeDesktopCleanups(desktop);
      //Feature 1767347: call DesktopCleanup before desktopDestroyed
View Full Code Here

  //HttpSessionAttributeListener//
  public void attributeAdded(HttpSessionBindingEvent evt) {
    final String name = evt.getName();
    if (!shallIgnore(name)) {
      final Session sess = Sessions.getCurrent();
      if (sess instanceof SimpleSession
      && evt.getSession().equals(sess.getNativeSession()))
        ((SimpleSession)sess).getScopeListeners()
          .notifyAdded(name, evt.getValue());
    }
  }
View Full Code Here

    }
  }
  public void attributeRemoved(HttpSessionBindingEvent evt) {
    final String name = evt.getName();
    if (!shallIgnore(name)) {
      final Session sess = Sessions.getCurrent();
      if (sess instanceof SimpleSession
      && evt.getSession().equals(sess.getNativeSession()))
        ((SimpleSession)sess).getScopeListeners()
          .notifyRemoved(name);
    }
  }
View Full Code Here

    }
  }
  public void attributeReplaced(HttpSessionBindingEvent evt) {
    final String name = evt.getName();
    if (!shallIgnore(name)) {
      final Session sess = Sessions.getCurrent();
      if (sess instanceof SimpleSession
      && evt.getSession().equals(sess.getNativeSession()))
        ((SimpleSession)sess).getScopeListeners()
          .notifyReplaced(name, evt.getValue());
    }
  }
View Full Code Here

    final boolean bRichlet = path != null && path.length() > 0;
    if (!bRichlet)
      path = Https.getThisServletPath(request);
//    if (D.ON && log.finerable()) log.finer("Creates from "+path);

    final Session sess = WebManager.getSession(getServletContext(), request);
    if (!SessionsCtrl.requestEnter(sess)) {
      response.sendError(response.SC_SERVICE_UNAVAILABLE,
        Messages.get(MZk.TOO_MANY_REQUESTS));
      return;
    }
    try {
      final Object old = I18Ns.setup(sess, request, response,
        sess.getWebApp().getConfiguration().getResponseCharset());
      try {
        if (!process(sess, request, response, path, bRichlet))
          handleError(sess, request, response, path, null);
      } catch (Throwable ex) {
        handleError(sess, request, response, path, ex);
View Full Code Here

  public static final Session getSession(WebApp wapp, Object navsess) {
    final SessionCache sc = ((WebAppCtrl)wapp).getSessionCache();
    if (sc == null) return null;
      //bug 2668190: happens when destroying app in WebSphere 7

    final Session sess = sc.get(navsess);
    if (sess != null && sess.getNativeSession() != navsess)
      ((SessionCtrl)sess).recover(navsess);
    return sess;
  }
View Full Code Here

   * @since 3.0.5
   */
  public static final
  Session newSession(WebApp wapp, Object navsess, Object request) {
    final WebAppCtrl wappc = (WebAppCtrl)wapp;
    final Session sess =
      wappc.getUiFactory().newSession(wapp, navsess, request);
    wappc.getSessionCache().put(sess);

    //Note: we set timeout here, because HttpSession might have been created
    //by other servlet or filter
    final int v = wapp.getConfiguration().getSessionMaxInactiveInterval();
    if (v != 0) sess.setMaxInactiveInterval(v);
    return sess;
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.Session

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.