Like the<ui:decorate>
tag, the<ui:fragment>
tag is also a non-trimming tag. Facelets preserves the markup outside this tag.
One difference between the<ui:decoration>
and the<ui:fragment>
tags, however, is that Facelets includes the content of the<ui:fragment>
tag inside a UI component. In this way, the<ui:fragment>
and the<ui:component>
tag have similar behavior.
Another difference between the<ui:decorate>
and the<ui:fragment>
tags is that the<ui:fragment>
tag does not support the template
attribute, but instead has a binding
attribute that gives us the ability to bind the tag to a UI component in our backing bean.
<!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> <head> <meta http-equiv="Content...