Package org.zkoss.zk.ui

Examples of org.zkoss.zk.ui.WebApp


   */
  protected boolean process(Session sess,
  HttpServletRequest request, HttpServletResponse response, String path,
  boolean bRichlet)
  throws ServletException, IOException {
    final WebApp wapp = sess.getWebApp();
    final WebAppCtrl wappc = (WebAppCtrl)wapp;
    final Configuration config = wapp.getConfiguration();

    final boolean bInclude = Servlets.isIncluded(request);
    final boolean compress = _compress && !bInclude;
    final Writer out = compress ? (Writer)new StringWriter(): response.getWriter();
    final DesktopRecycle dtrc = bInclude ? null: config.getDesktopRecycle();
View Full Code Here


  HttpServletResponse response, String content)
  throws ServletException, IOException {
    if (log.debugable()) log.debug("Content to filter:\n"+content);

    final WebManager webman = WebManager.getWebManager(_ctx);
    final WebApp wapp = webman.getWebApp();
    final WebAppCtrl wappc = (WebAppCtrl)wapp;
    final Session sess = webman.getSession(_ctx, request);
    final Object old = I18Ns.setup(sess, request, response, _charset);
    try {
      final String path = Https.getThisServletPath(request);
View Full Code Here

    //Bug 1753712: disable visualizer since responses were gen.
    ((ExecutionCtrl)exec).getVisualizer().disable();

    //Bug 1868371: we shall postpone the cleanup to the last step
    final Desktop dt = exec.getDesktop();
    final WebApp wapp = dt.getWebApp();
    final DesktopRecycle dtrc = wapp.getConfiguration().getDesktopRecycle();
    if (dtrc == null || !beforeRemove(dtrc, exec, dt))
      ((WebAppCtrl)wapp).getDesktopCache(dt.getSession()).removeDesktop(dt);
  }
View Full Code Here

      _cache.clear();
  }
  /** Returns whether to generate JS files that is easy to debug. */
  public boolean isDebugJS() {
    if (_debugJS == null) {
      final WebApp wapp = getWebApp();
      if (wapp == null) return true; //zk lighter
      _debugJS = Boolean.valueOf(wapp.getConfiguration().isDebugJS());
    }
    return _debugJS.booleanValue();
  }
View Full Code Here

        updateURI = DHtmlLayoutServlet.fixUpdateURI(updateURI, ATTR);
      webman = new WebManager(ctx, updateURI);
    }

    final Session sess = WebManager.getSession(ctx, request);
    final WebApp wapp = sess.getWebApp();
    final WebAppCtrl wappc = (WebAppCtrl)wapp;
    final Object old = I18Ns.setup(sess, request, response,
      wapp.getConfiguration().getResponseCharset());
    Execution exec = null;
    try {
      final Desktop desktop = webman.getDesktop(sess, request, response, path, true);
      if (desktop == null) //forward or redirect
        return;
View Full Code Here

      } else {
        log.warning("Unknown element "+elnm+", "+el.getLocator()+", "+path);
      }
    }
    if (zk) {
      final WebApp wapp = getWebApp();
      if (wapp != null)
        writeAppInfo(out, wapp);
       write(out, '}'); //end of if(window.zk)

      writeHost(wc, out, wapp);
View Full Code Here

  public void init(Object context, Configuration config) {
    if (_config != null)
      throw new IllegalStateException("Cannot be initialized twice");
    if (config == null)
      throw new IllegalArgumentException("null");
    final WebApp oldwapp = config.getWebApp();
    if (oldwapp != null && oldwapp != this)
      throw new IllegalArgumentException("config already belongs to other Web app, "+oldwapp);

    _config = config;
    _config.setWebApp(this);
View Full Code Here

  }

  /** Returns the session. */
  private Session getSession(RenderRequest request)
  throws PortletException {
    final WebApp wapp = getWebManager().getWebApp();
    final PortletSession psess = request.getPortletSession();
    final Session sess = SessionsCtrl.getSession(wapp, psess);
    return sess != null ? sess:
      SessionsCtrl.newSession(wapp, psess, request);
  }
View Full Code Here

  protected boolean process(Session sess, RenderRequest request,
  RenderResponse response, String path, boolean bRichlet)
  throws PortletException, IOException {
    if (D.ON && log.debugable()) log.debug("Creates from "+path);
    final WebManager webman = getWebManager();
    final WebApp wapp = webman.getWebApp();
    final WebAppCtrl wappc = (WebAppCtrl)wapp;

    final HttpServletRequest httpreq = RenderHttpServletRequest.getInstance(request);
    final HttpServletResponse httpres = RenderHttpServletResponse.getInstance(response);
    final ServletContext svlctx = (ServletContext)wapp.getNativeContext();

    final DesktopRecycle dtrc = wapp.getConfiguration().getDesktopRecycle();
    Desktop desktop = dtrc != null ? Utils.beforeService(dtrc, svlctx, sess, httpreq, httpres, path): null;

    try {
      if (desktop != null) { //recycle
        final Page page = Utils.getMainPage(desktop);
View Full Code Here

   * properly)
   * @since 5.0.0
   */
  public static final WebApp getWebApp(ServletContext ctx) {
    final WebManager webman = getWebManagerIfAny(ctx);
    final WebApp wapp = webman != null ? webman.getWebApp(): null;
    if (wapp == null)
      throw new UiException("The Web application not found. Make sure <load-on-startup> is specified for "+DHtmlLayoutServlet.class.getName());
    return wapp;
  }
View Full Code Here

TOP

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

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.