This tag is used to define the name of the content. This named content can be included within a template. This tag is used within those tags that allows templating like composition and decorate tags. This tag takes one attribute named "name" that is required to be included when using this define tag. This name attribute is required to be same as name attribute of insert tag in the target template to include the content specified in define tag with the same name. For example, In the first define tag name attribute is set to "face1". Now look at the code below in "definetemplate.xhtml" where we have used insert tag with name attribute. This name attribute is given value "face1". So the content within define tag, whose name attribute value matches with the name attribute of the insert tag i.e."face1", will be included in the "definetemplate.xhtml".
Code Description :
define.xhtml :
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html"> Content above composition tag will not be rendered. RoseIndia Facelet Tags TutorialWelcome to the Facelet world..........Content below composition tag will not be rendered. |
definetemplate.xhtml :
xmlns:ui="http://java.sun.com/jsf/facelets"> |
Rendered Output :
Html Source Code :
RoseIndia Facelet Tags TutorialWelcome to the Facelet world..........Enter UserID : Enter Password : |
This tag contains only one attribute :
name : This attribute is used to give the name of the content specified in the define tag. This value of name attribute must be same as name attribute in insert tag if its content is to be included in the template.
0 comments:
Post a Comment