Package org.apache.myfaces.view.facelets

Public Facelet API.

See: Description

Package org.apache.myfaces.view.facelets Description

Public Facelet API. Most developers should be able to utilizing the framework using the public classes and interfaces.

An application that wishes to use Facelets as a ViewHandler, they must specify the following in their faces-config.xml (@see com.sun.facelets.FaceletViewHandler).


Below is sample code for using Facelets at the API level with JavaServer Faces.

// get the view to render
FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot viewToRender = context.getViewRoot();

// grab our FaceletFactory and create a Facelet
FaceletFactory factory = FaceletFactory.getInstance();
Facelet f = factory.getFacelet(viewToRender.getViewId());

// populate UIViewRoot
f.apply(context, viewToRender);

Copyright © 2016 The Apache Software Foundation. All Rights Reserved.