code: public static CmsDialog initCmsDialog(PageContext context, HttpServletRequest req, HttpServletResponse res) {
  
          CmsDialog wp = (CmsDialog)req.getAttribute(CmsWorkplace.SESSION_WORKPLACE_CLASS);
          if (wp == null) {
              // ensure that we don't get null pointers if the page is directly called
              wp = new CmsDialog(new CmsJspActionElement(context, req, res));
              wp.fillParamValues(req);
          }
          return wp;
      }
docs: Returns an initialized CmsDialog instance that is read from the request attributes.<p>
  
  This method is used by dialog elements.
  The dialog elements do not initialize their own workplace class,
  but use the initialized instance of the "master" class.
  This is required to ensure that parameters of the "master" class
  can properly be kept on the dialog elements.<p>
  
  To prevent null pointer exceptions, an empty dialog is returned if
  nothing is found in the request attributes.<p>
  
  @param context the JSP page context
  @param req the JSP request
  @param res the JSP response
  
  @return an initialized CmsDialog instance that is read from the request attributes