FacesContext facesContext = FacesContext.getCurrentInstance(); FaceletFactory defaultFactory = ApplicationAssociate.getInstance(facesContext.getExternalContext()).getFaceletFactory(); Facelet facelet = defaultFactory.getFacelet(xhtmlUrl);
Facelet facelet = faceletFactory.getFacelet( resource.getURL() ); facelet.apply( ctx, facetComponent ); } catch ( IOException e ) {
/** * Gets the Facelet representing the specified view identifier. * * @param viewId * the view identifier * * @return the Facelet representing the specified view identifier * * @throws IOException * if a read or parsing error occurs */ private Facelet _getFacelet(String viewId) throws IOException { // grab our FaceletFactory and create a Facelet FaceletFactory.setInstance(_faceletFactory); try { return _faceletFactory.getFacelet(viewId); } finally { FaceletFactory.setInstance(null); } }
/** * Gets the Facelet representing the specified view identifier. * * @param viewId * the view identifier * * @return the Facelet representing the specified view identifier * * @throws IOException * if a read or parsing error occurs */ private Facelet _getFacelet(FacesContext context, String viewId) throws IOException { // grab our FaceletFactory and create a Facelet FaceletFactory.setInstance(_faceletFactory); try { return _faceletFactory.getFacelet(context, viewId); } finally { FaceletFactory.setInstance(null); } }
/** * Gets the Facelet representing the specified view identifier. * * @param viewId * the view identifier * * @return the Facelet representing the specified view identifier * * @throws IOException * if a read or parsing error occurs */ private Facelet _getFacelet(String viewId) throws IOException { // grab our FaceletFactory and create a Facelet FaceletFactory.setInstance(_faceletFactory); try { return _faceletFactory.getFacelet(viewId); } finally { FaceletFactory.setInstance(null); } }
protected void buildView(FacesContext context, UIViewRoot viewToRender) throws IOException, FacesException { // setup our viewId String renderedViewId = this.getRenderedViewId(context, viewToRender.getViewId()); viewToRender.setViewId(renderedViewId); if (log.isLoggable(Level.FINE)) { log.fine("Building View: " + renderedViewId); } // grab our FaceletFactory and create a Facelet Facelet f = null; FaceletFactory.setInstance(this.faceletFactory); try { f = this.faceletFactory.getFacelet(viewToRender.getViewId()); } finally { FaceletFactory.setInstance(null); } // populate UIViewRoot long time = System.currentTimeMillis(); f.apply(context, viewToRender); time = System.currentTimeMillis() - time; if (log.isLoggable(Level.FINE)) { log.fine("Took " + time + "ms to build view: " + viewToRender.getViewId()); } }
protected void buildView(FacesContext context, UIViewRoot viewToRender) throws IOException, FacesException { // setup our viewId String renderedViewId = this.getRenderedViewId(context, viewToRender.getViewId()); viewToRender.setViewId(renderedViewId); if (log.isLoggable(Level.FINE)) { log.fine("Building View: " + renderedViewId); } // grab our FaceletFactory and create a Facelet Facelet f = null; FaceletFactory.setInstance(this.faceletFactory); try { f = this.faceletFactory.getFacelet(viewToRender.getViewId()); } finally { FaceletFactory.setInstance(null); } // populate UIViewRoot long time = System.currentTimeMillis(); f.apply(context, viewToRender); time = System.currentTimeMillis() - time; if (log.isLoggable(Level.FINE)) { log.fine("Took " + time + "ms to build view: " + viewToRender.getViewId()); } }