HTML and CSS Reference
In-Depth Information
The following JSTL tags are used with the JSF deferred expressions in the example:
<c:forEach> for performing the iteration.
<c:choose> for defining a group of mutually exclusive choices. It is like the Java switch
<c:when> , which is like the Java case statement.
<c:other> , which is like the Java default statement.
In this example, the <c:forEach> iterates over the #{user.favoriteSport} list, and the current sport item is
represented by the #{sport} expression. The <c:when> tag checks if the current sport #{sport} value is 'Football'
and when it finds this value, the following sentence "Popular in Africa:" is highlighted and underlined and
appended to beginning of the list item. If the current sport does not equal 'Football' then the #{sport} is displayed
normally using the <c:otherwise> JSTL element. Figure 2-1 shows how the list items will appear.
Figure 2-1. The highlighted underlined list item
Note that in order to work with JSTL, you need to include the JSTL URI in the declaration, as shown in the
following bolded text:
<html xmlns=" "
xmlns:ui=" "
xmlns:h=" "
xmlns:f=" "
xmlns : c = " " >
In the JSF EL, there are two types of expressions:
Value expression.
Method expression.
In the next sections, we will dig into the details of both value and method expressions.
Search WWH ::

Custom Search