ui:component
<ui:component id="optionalId" binding="optionalValueExpression">
It defines a component which is created and added to the component tree. Content outside this component is not considered.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" > <h3>Text outside the ui:component.</h3> <ui:component> <h3>Text inside the ui:component.</h3> </ui:component> </html>
Output will be:
Text inside the ui:component.
ui:fragment
<ui:fragment id="optionalId" binding="optionalValueExpression">
Similar to the component tag but does not disregard content outside this tag.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" > <h3>Text outside the ui:fragment.</h3> <ui:fragment> <h3>Text inside the ui:fragment.</h3> </ui:fragment> </html>
Output will be:
Text outside the ui:fragment. Text inside the ui:fragment.
ui:remove
<ui:remove>
It is used to do commenting in jsf.
Example:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" > <h:body> <ui:remove> <h:commandButton value="Ok" /> </ui:remove> </h:body> </html>
Generated HTML will be as:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <body> </body> </html>
ui:debug
It is used to capture debugging information like component tree, scoped variables etc.
<ui:debug hotkey="optionalHotKey" rendered="true|false|el expression"/>
If we do not specify hotkey, then after the page is rendered then press- ctrl+shift+d and then a pop up will open up having details of component tree,scoped variables etc. For rendering this component rendered attribute should be true, else debugging pop won't get open on pressing ctrl+shift+d.
>