public function initialize($defaultController='', $defaultContext='', $defaultAction='login') {
    $config = ObjectFactory::getInstance('configuration');
    $this->debug = $config->getBooleanValue('debug', 'Application');

    // configure php
    if ($config->hasSection('phpconfig')) {
      $phpSettings = $config->getSection('phpconfig');
      foreach ($phpSettings as $option => $value) {
        ini_set($option, $value);
      }
    }

    // create the Request and Response instances
    $this->request = ObjectFactory::getInstance('request');
    $this->response = ObjectFactory::getInstance('response');
    $this->request->setResponse($this->response);

    $this->request->initialize($defaultController, $defaultContext, $defaultAction);

    // initialize session
    $session = ObjectFactory::getInstance('session');

    // load user configuration
    $principalFactory = ObjectFactory::getInstance('principalFactory');
    $authUser = $principalFactory->getUser($session->getAuthUser(), true);
    if ($authUser && strlen($authUser->getConfig()) > 0) {
      $config->addConfiguration($authUser->getConfig(), true);
    }

    // load event listeners
    $listeners = $config->getValue('listeners', 'application');
    foreach ($listeners as $key) {
      ObjectFactory::getInstance($key);
    }

    // set timezone
    date_default_timezone_set($config->getValue('timezone', 'application'));

    // return the request
    return $this->request;
  }