[OmniFaces utilities] The
getViewDeclarationLanguage() method returns the ViewDeclarationLanguage associated with the "current" view ID.Method:
Usage:
Starting
with JSF 2.2, we can use an explicit API for instantiating composite components
programmatically. The core of this API is based on the new createComponent() method added in the ViewDeclarationLanguage class. For getting the ViewDeclarationLanguage , you can write in JSF:
FacesContext
context = FacesContext.getCurrentInstance();
ViewDeclarationLanguage
vdl =
context.getApplication().getViewHandler().getViewDeclarationLanguage(context,
context.getViewRoot().getViewId());
But, you can
compact this via Faces#getViewDeclarationLanguage() as:
import
org.omnifaces.util.Faces;
...
ViewDeclarationLanguage
vdl = Faces.getViewDeclarationLanguage();
or,
import
static org.omnifaces.util.Faces.getViewDeclarationLanguage;
...
ViewDeclarationLanguage
vdl = getViewDeclarationLanguage();






Arrays
Converters
JSF 2 Tutorials at www.mkyong.com
JavaServer Faces (JSF) Tutorial 


















Niciun comentariu :
Trimiteți un comentariu