public function printDocument()
    {
        header("Content-Type: {$this->_contentType}; {$this->_charset}");

        try {
            $this->controller->processRequest();
        } catch (Exception $e) {
            $message = substr(
                preg_replace('/\s+/', ' ', $e->getMessage()), 0, 150
            );
            header("HTTP/1.0 400 $message");
            throw $e;
        }

        echo $this->getDocument();
    }