This tag is used to pass objects as variables between facelets. This tag has two required attributes name and value. name attribute is the name of the variable and the value attribute is to set the value of this variable. You can use this tag where a define tag is used within composition or decorate tag. We can also use this tag within include tag. In this example, we have taken two variables user and pwd within include tag in debug.xhtml and values are set through bean's properties userid and password. These variable are passed to the "includeparampage.xhtml" where we can use these variables in this line of code "Your #{user} and #{pwd} will not be disclosed".
Code Description :
debug.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. |
debugtemplate.xhtml :
xmlns:ui="http://java.sun.com/jsf/facelets"> |
includeparampage.xhtml :
xmlns:ui="http://java.sun.com/jsf/facelets"> Your #{user} and #{pwd} will not be disclosed. |
Rendered Output :
Html Source Code :
RoseIndia Facelet Tags TutorialWelcome to the Facelet world..........Enter UserID : Enter Password : name="is" value="" /> Your ID and Password will not be disclosed. |
This tag contains two attributes :
name : This is required attribute and is used to specify the name of the variable to be passed to other facelet.
value : This is required attribute to set the value of the variable specified by the name attribute.
0 comments:
Post a Comment