code: public static CmsObject getCmsObject(ServletRequest req) {
  
          CmsFlexController controller = (CmsFlexController)req.getAttribute(ATTRIBUTE_NAME);
          if (controller != null) {
              return controller.getCmsObject();
          } else {
              return null;
          }
      }
docs: Returns the wrapped CmsObject form the provided request, or <code>null</code> if the
  request is not running inside OpenCms.<p>
  
  @param req the current request
  @return the wrapped CmsObject