protected function dispatch(Request $servletRequest, Response $servletResponse)
    {
        $mapperHandler = null;
        try {
            /**
             * @var $mv ModelAndView
             */
            $mv = null;
            $dispatchException = null;
            try {
                $mappedHandler = $this->getHandler($servletRequest);
                if ($mappedHandler == null || $mappedHandler->getHandler() == null) {
                    $this->noHandlerFound($servletRequest, $servletResponse);
                    return;
                }
                $ha = $this->getHandlerAdapter($mappedHandler->getHandler());
                if (!$mappedHandler->applyPreHandle($servletRequest, $servletResponse)) {
                    return;
                }
                $mv = $ha->handle($servletRequest, $servletResponse, $mappedHandler->getHandler());
                $mappedHandler->applyPostHandle($servletRequest, $servletResponse, $mv);
            } catch (\Exception $ex) {
                $dispatchException = $ex;
            }
            $this->processDispatchResult($servletRequest, $servletResponse, $mappedHandler, $mv, $dispatchException);
        } catch (\Exception $ex) {
            $this->triggerAfterCompletion($servletRequest, $servletResponse, $mappedHandler, $ex);
        }
    }