code: protected CmsFlexController getController(
          CmsObject cms,
          CmsResource resource,
          HttpServletRequest req,
          HttpServletResponse res,
          boolean streaming,
          boolean top) {
  
          CmsFlexController controller = null;
          if (top) {
              // only check for existing controller if this is the "top" request/response
              controller = CmsFlexController.getController(req);
          }
          if (controller == null) {
              // create new request / response wrappers
              controller = new CmsFlexController(cms, resource, m_cache, req, res, streaming, top);
              CmsFlexController.setController(req, controller);
              CmsFlexRequest f_req = new CmsFlexRequest(req, controller);
              CmsFlexResponse f_res = new CmsFlexResponse(res, controller, streaming, true);
              controller.push(f_req, f_res);
          } else if (controller.isForwardMode()) {
              // reset CmsObject (because of URI) if in forward mode
              controller = new CmsFlexController(cms, controller);
              CmsFlexController.setController(req, controller);
          }
          return controller;
      }
docs: Delivers a Flex controller, either by creating a new one, or by re-using an existing one.<p>
  
  @param cms the initial CmsObject to wrap in the controller
  @param resource the resource requested
  @param req the current request
  @param res the current response
  @param streaming indicates if the response is streaming
  @param top indicates if the response is the top response
  
  @return a Flex controller