コード例 #1
0
  /** @param servletHandler The servletHandler to set. */
  public void setServletHandler(ServletHandler servletHandler) {
    if (isStarted()) throw new IllegalStateException("STARTED");

    Handler next = null;
    if (_servletHandler != null) {
      next = _servletHandler.getHandler();
      _servletHandler.setHandler(null);
      replaceHandler(_servletHandler, servletHandler);
    }
    _servletHandler = servletHandler;
    if (next != null && _servletHandler.getHandler() == null) _servletHandler.setHandler(next);
    relinkHandlers();
  }
コード例 #2
0
  /** @param gzipHandler The {@link GzipHandler} to set on this context. */
  public void setGzipHandler(GzipHandler gzipHandler) {
    if (isStarted()) throw new IllegalStateException("STARTED");

    Handler next = null;
    if (_gzipHandler != null) {
      next = _gzipHandler.getHandler();
      _gzipHandler.setHandler(null);
      replaceHandler(_gzipHandler, gzipHandler);
    }

    _gzipHandler = gzipHandler;
    if (next != null && _gzipHandler.getHandler() == null) _gzipHandler.setHandler(next);
    relinkHandlers();
  }