def do_dispatch(env)
      path = env['PATH_INFO']

      # Try to serve a public file
      ret = dispatch_public(env, path)
      return ret if not ret.nil?

      log.debug "Checking for routes that match: #{path}"
      route = router.match(env)

      if route.has_key? :ok
        dispatch_controller(route, env)
      else
        [404, {"Content-Type" => "text/plain"}, ["404 Not Found: #{path}"]]
      end
    end
def do_dispatch(env)
      path = env['PATH_INFO']

      # Try to serve a public file
      ret = dispatch_public(env, path)
      return ret if not ret.nil?

      log.debug "Checking for routes that match: #{path}"
      route = router.match(env)

      if route.has_key? :ok
        dispatch_controller(route, env)
      else
        [404, {"Content-Type" => "text/plain"}, ["404 Not Found: #{path}"]]
      end
    end
Route, instantiate controller, return response from controller's action.