HTML and CSS Reference
In-Depth Information
Value Expression
A value expression can be used for setting the value of a managed bean property or displaying the value of a managed
bean property or any dynamically evaluated object. We have seen several examples so far for the value expressions.
For example, the following #{user.name} expression in the welcome.xhtml page of the firstApplication represents
a value expression that displays the name of the User managed bean:
Welcome, #{user.name}!
While the same #{user.name} expression in the login page ( index.xhtml ) of the firstApplication represents a
value expression that sets the name of the User managed bean:
<h:inputText id="userName" value="#{user.name}" required="true"/>
as we know from Chapter 1, the binding between the EditableValueHolder 's (such as inputText and
selectOneMenu ) value and the JSF eL expression (model) is performed in the Update Model Values phase of the JSF
request processing life cycle.
Note
Value expressions can also access implicit objects. Table 2-1 shows the JSF implicit objects that are available for
the JSF EL per the JSF specification.
Table 2-1. The JSF EL Available Implicit Objects
Implicit Object
Representation
Application
ServletContext if you are working on a Servlet container or the PortletContext if you are
working on a Portlet container.
applicationScope
application scoped map (the application attributes map).
Cookie
HTTP cookie map.
facesContext
current FacesContext instance.
Component
UIComponent instance (will be detailed in “Creating Custom JSF Components” in chapters 6-8).
Cc
parent composite component (will be detailed in “Creating Custom JSF Components” in
chapters 6-8).
Flash
flash scoped map (will be illustrated in detail in the flash scope section).
Header
request HTTP headers map.
headerValues
request HTTP headers map. However, every value of the map is a String[] that represents the
header key values.
initParam
init parameters map of the application.
Param
request query parameters map.
paramValues
request query parameters map. However, every value of the map is a String[] that represents
the parameter key values.
Request
ServletRequest if you are working on a Servlet container or the PortletRequest if you are
working on a Portlet container.
( continued )
 
Search WWH ::




Custom Search