Java Reference
In-Depth Information
Modifying the URL so that it has the displayConditionalText request parameter
and one of the expected values results in the corresponding markup being rendered
in the page.
Just like the JSTL <c:if> tag, the JSTL <c:when> tag has access to all JSTL implicit
objects.
In our examples we have been using the equality logical operator ( == ) to compare
two objects. This operator is equivalent to the equals() method in java.lang.
Object . There are several other operators that can be used in JSTL expressions; the
following table summarizes the most commonly used ones:
Operator type
Operators
Arithmetic
+ , - , * , / (or div ), % (or mod )
Logical
&& (or and ), || (or or ), ! (or not ), empty
Relational
== (or eq ), > (or gt ), < (or lt ), >= (or ge ), <= (or le )
All of these operators should be intuitive to any moderately experienced Java
programmer. Notice that many of the operators have both symbolic and textual
versions. The reason for the textual versions is that they do not invalidate XML
pages, allowing us to use JSTL in XHTML or any other XML markup.
 
Search WWH ::




Custom Search