Package org.zkoss.zk.au

Examples of org.zkoss.zk.au.AuDecoder

@author tomyeh @since 5.0.4

      if (log.debugable()) log.debug("Error found at client: "+errClient+"\n"+Servlets.getDetail(request));

    //parse desktop ID
    final WebApp wapp = sess.getWebApp();
    final WebAppCtrl wappc = (WebAppCtrl)wapp;
    final AuDecoder audec = getAuDecoder(wapp);
    final String dtid = audec.getDesktopId(request);
    if (dtid == null) {
      //Bug 1929139: incomplete request (IE only)
      if (log.debugable()) {
        final String msg = "Incomplete request\n"+Servlets.getDetail(request);
        log.debug(msg);
      }

      response.sendError(467, "Incomplete request");
      return;
    }

    Desktop desktop = getDesktop(sess, dtid);
    if (desktop == null) {
      final String cmdId = audec.getFirstCommand(request);
      if (!"rmDesktop".equals(cmdId))
        desktop = recoverDesktop(sess, request, response, wappc, dtid);

      if (desktop == null) {
        response.setIntHeader("ZK-Error", response.SC_GONE); //denote timeout
        sessionTimeout(request, response, wapp, dtid);
        return;
      }
    }
    WebManager.setDesktop(request, desktop);
      //reason: a new page might be created (such as include)

    final String sid = request.getHeader("ZK-SID");
    if (sid != null) //Some client might not have ZK-SID
      response.setHeader("ZK-SID", sid);

    //parse commands
    final Configuration config = wapp.getConfiguration();
    final List aureqs;
    boolean keepAlive = false;
    try {
      final boolean timerKeepAlive = config.isTimerKeepAlive();
      aureqs = audec.decode(request, desktop);
      for (Iterator it = aureqs.iterator(); it.hasNext();) {
        final String cmdId = ((AuRequest)it.next()).getCommand();
        keepAlive = !(!timerKeepAlive && Events.ON_TIMER.equals(cmdId))
          && !"dummy".equals(cmdId);
          //dummy is used for PollingServerPush for piggyback
View Full Code Here


    out.write(new AuAlert(errmsg));
    out.close(request, response);
  }

  private static final AuDecoder getAuDecoder(WebApp wapp) {
    AuDecoder audec = wapp != null ? ((WebAppCtrl)wapp).getAuDecoder(): null;
    return audec != null ? audec: _audec;
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zk.au.AuDecoder

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.