protected void renderBundleLinks ( ResourceBundlePathsIterator it , BundleRendererContext ctx , boolean debugOn , Writer out ) throws IOException { String contextPath = ctx . getContextPath ( ) ; boolean useGzip = ctx . isUseGzip ( ) ; boolean isSslRequest = ctx . isSslRequest ( ) ; // Add resources to the page as links. Random randomSeed = new Random ( ) ; while ( it . hasNext ( ) ) { BundlePath bundlePath = it . nextPath ( ) ; if ( bundlePath != null ) { String resourceName = bundlePath . getPath ( ) ; if ( resourceName != null ) { // Handle external URL if ( bundlePath . isExternalURL ( ) ) { out . write ( renderLink ( resourceName ) ) ; } else if ( debugOn && useRandomParam ) { // In debug mode, all the resources are included // separately // and // use a random parameter to avoid caching. // If useRandomParam is set to false, the links are // created // without the random parameter. int random = randomSeed . nextInt ( ) ; if ( random < 0 ) { random *= - 1 ; } out . write ( createBundleLink ( resourceName , bundlePath . getBundlePrefix ( ) , "d=" + random , contextPath , isSslRequest ) ) ; // } else if (!debugOn && bundlePath.isProductionURL()) // { // out.write(renderLink(resourceName)); } else if ( ! debugOn && useGzip ) { out . write ( createGzipBundleLink ( resourceName , bundlePath . getBundlePrefix ( ) , contextPath , isSslRequest ) ) ; } else { out . write ( createBundleLink ( resourceName , bundlePath . getBundlePrefix ( ) , null , contextPath , isSslRequest ) ) ; } if ( debugOn && ! ctx . getIncludedResources ( ) . add ( resourceName ) ) { addComment ( "The resource '" + resourceName + "' is already included in the page." , out ) ; } } } } }
Renders the bundle links for the resource iterator passed in parameter