Home Jsf Jsftraining Binding Component Value to an Implicit Object
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Binding Component Value to an Implicit Object

Advertisement
JSF provides list of implicit objects. These objects can be referred in value attribute of component in the JSP page.

Binding Component Value to an Implicit Object

        

JSF provides list of implicit objects. These objects can be referred in value attribute of component in the JSP page.

Implicit Object Description
applicationScope Represents a Map of application scope attribute values with attribute names as keys
cookie Represents a Map of cookie values for the current request with cookie names as keys
facesContext Represents the FacesContext instance for the current request
header Represents a Map of HTTP header values for the current request with header names as keys
headerValues Represents a Map of String arrays containing all the header values for HTTP headers in the current request with header names as keys
initParam Represents a Map of the context initialization parameters
param Represents a Map of the request parameters for this request with parameter names as keys
paramValues Represents a Map of String arrays containing all the parameter values for request parameters in the current request with parameter names as keys
requestScope Represents a Map of the request attributes for this request with attribute names as keys
sessionScope Represents a Map of the session attributes for this request with attribute names as keys
view Represents The root UIComponent in the current component tree stored in the FacesRequest for this request

For example:

Session Scoped parameter can be accessed as below:

<h:outputFormat value="Session Scope Value Is: {0}" rendered="#{!(sessionScope.username==null)}">
<f:param value="#{sessionScope.username}"/>
</h:outputFormat>

Request Scoped parameter can be accessed as below:

<h:outputFormat value="Request Scope Value Is: {0}" rendered="#{!(requestScope.value==null)}">
<f:param value="#{requestScope.value}"/>
</h:outputFormat>

Download code for all examples

Advertisement

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 30, 2008

Ask Questions?    Discuss: Binding Component Value to an Implicit Object  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com