public String render(String resourceName,String screenName,boolean asString) throws GeneralException, IOException, SAXException, ParserConfigurationException {
  ModelScreen modelScreen=ScreenFactory.getScreenFromLocation(resourceName,screenName);
  if (modelScreen.getUseCache()) {
    WidgetContextCacheKey wcck=new WidgetContextCacheKey(context);
    String screenCombinedName=resourceName + ":" + screenName;
    ScreenCache screenCache=new ScreenCache();
    GenericWidgetOutput gwo=screenCache.get(screenCombinedName,wcck);
    if (gwo == null) {
      Writer sw=new StringWriter();
      modelScreen.renderScreenString(sw,context,screenStringRenderer);
      gwo=new GenericWidgetOutput(sw.toString());
      screenCache.put(screenCombinedName,wcck,gwo);
      if (asString) {
        return gwo.toString();
      }
 else {
        writer.append(gwo.toString());
      }
    }
 else {
      if (asString) {
        return gwo.toString();
      }
 else {
        writer.append(gwo.toString());
      }
    }
  }
 else {
    context.put("renderFormSeqNumber",String.valueOf(renderFormSeqNumber));
    if (asString) {
      Writer sw=new StringWriter();
      modelScreen.renderScreenString(sw,context,screenStringRenderer);
      return sw.toString();
    }
 else {
      modelScreen.renderScreenString(writer,context,screenStringRenderer);
    }
  }
  return "";
}

public String render ( String resourceName , String screenName , boolean asString ) throws GeneralException , IOException , SAXException , ParserConfigurationException { ModelScreen modelScreen = ScreenFactory . getScreenFromLocation ( resourceName , screenName ) ; if ( modelScreen . getUseCache ( ) ) { WidgetContextCacheKey wcck = new WidgetContextCacheKey ( context ) ; String screenCombinedName = resourceName + ":" + screenName ; ScreenCache screenCache = new ScreenCache ( ) ; GenericWidgetOutput gwo = screenCache . get ( screenCombinedName , wcck ) ; if ( gwo == null ) { Writer sw = new StringWriter ( ) ; modelScreen . renderScreenString ( sw , context , screenStringRenderer ) ; gwo = new GenericWidgetOutput ( sw . toString ( ) ) ; screenCache . put ( screenCombinedName , wcck , gwo ) ; if ( asString ) { return gwo . toString ( ) ; } else { writer . append ( gwo . toString ( ) ) ; } } else { if ( asString ) { return gwo . toString ( ) ; } else { writer . append ( gwo . toString ( ) ) ; } } } else { context . put ( "renderFormSeqNumber" , String . valueOf ( renderFormSeqNumber ) ) ; if ( asString ) { Writer sw = new StringWriter ( ) ; modelScreen . renderScreenString ( sw , context , screenStringRenderer ) ; return sw . toString ( ) ; } else { modelScreen . renderScreenString ( writer , context , screenStringRenderer ) ; } } return "" ; }
renders the named screen using the render environment configured when this screenrenderer was created . < p > scipio : modified for asstring boolean which returns as string instead of going straight to writer .
