/**
  * Redirects the web request to another uri.
  *
  * NOTE: This method only supports web requests and will throw an exception if used with other request types.
  *
  * @param mixed $uri Either a string representation of a URI or a \F3\FLOW3\Property\DataType\Uri object
  * @param integer $delay (optional) The delay in seconds. Default is no delay.
  * @param integer $statusCode (optional) The HTTP status code for the redirect. Default is "303 See Other"
  * @throws \F3\FLOW3\MVC\Exception\UnsupportedRequestTypeException If the request is not a web request
  * @throws \F3\FLOW3\MVC\Exception\StopActionException
  * @author Robert Lemke <*****@*****.**>
  * @api
  */
 protected function redirectToUri($uri, $delay = 0, $statusCode = 303)
 {
     if (!$this->request instanceof \F3\FLOW3\MVC\Web\Request) {
         throw new \F3\FLOW3\MVC\Exception\UnsupportedRequestTypeException('redirect() only supports web requests.', 1220539734);
     }
     $uri = $this->request->getBaseUri() . (string) $uri;
     $escapedUri = htmlentities($uri, ENT_QUOTES, 'utf-8');
     $this->response->setContent('<html><head><meta http-equiv="refresh" content="' . intval($delay) . ';url=' . $escapedUri . '"/></head></html>');
     $this->response->setStatus($statusCode);
     $this->response->setHeader('Location', (string) $uri);
     throw new \F3\FLOW3\MVC\Exception\StopActionException();
 }