Package com.caucho.server.webapp

Examples of com.caucho.server.webapp.WebApp


      cReq.setSessionId(sessionId);
  }

  protected final SessionManager getSessionManager()
  {
    WebApp app = getWebApp();
    if (app != null)
      return app.getSessionManager();
    else
      return null;
  }
View Full Code Here


    if (depend != null && depend.isModified()) {
      return true;
    }

    WebApp webApp = _webApp;

    if (webApp != null) {
      depend = webApp.getInvocationDependency();

      if (depend != null)
        return depend.isModified();
    }
View Full Code Here

    Dependency depend = _dependency;

    if (depend != null && depend.logModified(log))
      return true;

    WebApp app = _webApp;

    if (app != null) {
      depend = app.getInvocationDependency();

      if (depend != null)
        return depend.logModified(log);
    }
View Full Code Here

  {
    if (request.getAttribute(LOGIN_CHECK) != null)
      return;
    request.setAttribute(LOGIN_CHECK, "login");

    WebApp webApp = _webApp;

    String jUseCookieAuth = (String) request.getParameter("j_use_cookie_auth");

    Authenticator auth = getAuthenticator();

    if (auth instanceof CookieAuthenticator
        && ((CookieAuthenticator) auth).isCookieSupported(jUseCookieAuth)) {
      CookieAuthenticator cookieAuth = (CookieAuthenticator) auth;

      generateCookie(user, cookieAuth, webApp, request, response);
    }

    String path = request.getServletPath();

    if (path == null)
      path = request.getPathInfo();
    else if (request.getPathInfo() != null)
      path = path + request.getPathInfo();

    if (path.equals("")) {
      // Forward?
      path = request.getContextPath() + "/";
      response.sendRedirect(response.encodeRedirectURL(path));
      return;
    }

    if (path.endsWith("/j_security_check")) {
      RequestDispatcher disp;
      disp = webApp.getNamedDispatcher("j_security_check");

      if (disp == null)
        throw new ServletException(L.l("j_security_check servlet must be defined to use form-based login."));

      disp.forward(request, response);
View Full Code Here

      path = request.getContextPath() + "/";
      response.sendRedirect(response.encodeRedirectURL(path));
      return;
    }

    WebApp webApp = _webApp;

    String uri = request.getRequestURI();

    if (path.endsWith("/j_security_check")) {
      // server/12d8, server/12bs

      if (response instanceof CauchoResponse) {
        ((CauchoResponse) response).setNoCache(true);
      }
      else {
        response.setHeader("Cache-Control", "no-cache");
        response.setDateHeader("Expires", 0);
      }

      RequestDispatcher disp = webApp.getRequestDispatcher(_errorPage);
      disp.forward(request, response);
      return;
    }
    else if (uri.equals(_loginPage) || uri.equals(_errorPage)) {
      request.getRequestDispatcher(path).forward(request, response);
      return;
    }

    HttpSession session = request.getSession();

    session.setAttribute(LOGIN_SAVED_PATH, path);
    session.setAttribute(LOGIN_SAVED_QUERY, request.getQueryString());

    if (response instanceof CauchoResponse) {
      ((CauchoResponse) response).killCache();
      ((CauchoResponse) response).setNoCache(true);
    }
    else {
      response.setHeader("Cache-Control", "no-cache");
    }

    // In case where the authenticator is something like https:/
    if (! _loginPage.startsWith("/")) {
      response.sendRedirect(response.encodeRedirectURL(_loginPage));
      return;
    }

    // Forwards to the loginPage, never redirects according to the spec.
    request.setAttribute(LOGIN_CHECK, "login");
    //RequestDispatcher disp = app.getLoginDispatcher(loginPage);
    RequestDispatcher disp = webApp.getRequestDispatcher(_loginPage);
    disp.forward(request, response);

    if (log.isLoggable(Level.FINE))
      log.fine(this + " request '" + uri + "' has no authenticated user");
  }
View Full Code Here

    try {
      String className = EL.evalString(rawClassName, mapEnv);

      try {
        WebApp app = (WebApp) getServletContext();

        return Class.forName(className, false, app.getClassLoader());
      } catch (ClassNotFoundException e) {
        log.log(Level.WARNING, e.toString(), e);

        return null;
      }
View Full Code Here

    String contextURI = invocation.getContextURI();

    DependencyContainer dependencyList = new DependencyContainer();

    WebApp webApp = (WebApp) _webApp;

    String uriRealPath = webApp.getRealPath(contextURI);
    Path contextPath = webApp.getRootDirectory().lookup(uriRealPath);

    if (! contextPath.isDirectory())
      return;

    ArrayList<String> welcomeFileList = webApp.getWelcomeFileList();
    for (int i = 0; i < welcomeFileList.size(); i++) {
      String file = welcomeFileList.get(i);

      String realPath = webApp.getRealPath(contextURI + "/" + file);

      Path path = webApp.getRootDirectory().lookup(realPath);

      dependencyList.add(new Depend(path));
    }

    dependencyList.clearModified();
View Full Code Here

    if (_request.getMethod().equals("HEAD")) {
      isHead = true;
      _responseStream.setHead();
    }

    WebApp webApp = _request.getWebApp();

    int statusCode = res.getStatus();

    int majorCode = statusCode / 100;

    if (webApp != null) {
      if (majorCode == 5)
        webApp.addStatus500();
    }

    if (req != null) {
      HttpSession session = req.getMemorySession();
      if (session instanceof SessionImpl)
View Full Code Here

    _isLoadTldOnInit = isLoadOnInit;
  }

  public static long getCheckInterval()
  {
    WebApp webApp = WebApp.getCurrent();

    if (webApp == null)
      return -1;

    JspPropertyGroup jsp = webApp.getJsp();

    if (jsp != null)
      return jsp.getDependencyCheckInterval();
    else
      return -1;
View Full Code Here

  /**
   * Initialize the manager.
   */
  public void init()
  {
    WebApp app = getWebApp();

    app.getJspApplicationContext().setPageManager(this);

    if (_isLoadTldOnInit) {
      try {
        TldManager tld = TldManager.create(new AppResourceManager(app), app);

View Full Code Here

TOP

Related Classes of com.caucho.server.webapp.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.