%@ page import="java.util.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/ea/core" %>
JSTL: EcmaScript EL Support -- Comparison Operator Example
Comparison Operators
The Comparison operators compare values for equality and identity and return a boolean value depending on the result of the comparison. Numbers, strings, and boolean values are compared by value. Objects, arrays, and functions are compared by reference.
Here are some examples:
<% request.setAttribute("myString", new String("Harrison Ford")); %>
<% request.setAttribute("a", new Integer(4)); %>
<% request.setAttribute("b", new Integer(7)); %>
<% request.setAttribute("c", new Integer(0)); %>
Operator: == (Equality)
Operator: != (Inequality)
Operator: === (Identity)
Operator: !== (Non-Identity)
Operator: < (Less Than)
Operator: > (Greater Than)
Operator: <= (Less Than or Equal)
Operator: >= (Greater Than or Equal)