source: nutchez-0.1/tomcat/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp.html @ 228

Last change on this file since 228 was 66, checked in by waue, 15 years ago

NutchEz - an easy way to nutch

File size: 3.4 KB
Line 
1<html><body><pre>
2&lt;!--
3 Licensed to the Apache Software Foundation (ASF) under one or more
4  contributor license agreements.  See the NOTICE file distributed with
5  this work for additional information regarding copyright ownership.
6  The ASF licenses this file to You under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with
8  the License.  You may obtain a copy of the License at
9
10      http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17-->
18&lt;html>
19  &lt;head>
20    &lt;title>JSP 2.0 Expression Language - Basic Comparisons&lt;/title>
21  &lt;/head>
22  &lt;body>
23    &lt;h1>JSP 2.0 Expression Language - Basic Comparisons&lt;/h1>
24    &lt;hr>
25    This example illustrates basic Expression Language comparisons.
26    The following comparison operators are supported:
27    &lt;ul>
28      &lt;li>Less-than (&amp;lt; or lt)&lt;/li>
29      &lt;li>Greater-than (&amp;gt; or gt)&lt;/li>
30      &lt;li>Less-than-or-equal (&amp;lt;= or le)&lt;/li>
31      &lt;li>Greater-than-or-equal (&amp;gt;= or ge)&lt;/li>
32      &lt;li>Equal (== or eq)&lt;/li>
33      &lt;li>Not Equal (!= or ne)&lt;/li>
34    &lt;/ul>
35    &lt;blockquote>
36      &lt;u>&lt;b>Numeric&lt;/b>&lt;/u>
37      &lt;code>
38        &lt;table border="1">
39          &lt;thead>
40      &lt;td>&lt;b>EL Expression&lt;/b>&lt;/td>
41      &lt;td>&lt;b>Result&lt;/b>&lt;/td>
42    &lt;/thead>
43    &lt;tr>
44      &lt;td>\${1 &amp;lt; 2}&lt;/td>
45      &lt;td>${1 &lt; 2}&lt;/td>
46    &lt;/tr>
47    &lt;tr>
48      &lt;td>\${1 lt 2}&lt;/td>
49      &lt;td>${1 lt 2}&lt;/td>
50    &lt;/tr>
51    &lt;tr>
52      &lt;td>\${1 &amp;gt; (4/2)}&lt;/td>
53      &lt;td>${1 > (4/2)}&lt;/td>
54    &lt;/tr>
55    &lt;tr>
56      &lt;td>\${1 &amp;gt; (4/2)}&lt;/td>
57      &lt;td>${1 > (4/2)}&lt;/td>
58    &lt;/tr>
59    &lt;tr>
60      &lt;td>\${4.0 &amp;gt;= 3}&lt;/td>
61      &lt;td>${4.0 >= 3}&lt;/td>
62    &lt;/tr>
63    &lt;tr>
64      &lt;td>\${4.0 ge 3}&lt;/td>
65      &lt;td>${4.0 ge 3}&lt;/td>
66    &lt;/tr>
67    &lt;tr>
68      &lt;td>\${4 &amp;lt;= 3}&lt;/td>
69      &lt;td>${4 &lt;= 3}&lt;/td>
70    &lt;/tr>
71    &lt;tr>
72      &lt;td>\${4 le 3}&lt;/td>
73      &lt;td>${4 le 3}&lt;/td>
74    &lt;/tr>
75    &lt;tr>
76      &lt;td>\${100.0 == 100}&lt;/td>
77      &lt;td>${100.0 == 100}&lt;/td>
78    &lt;/tr>
79    &lt;tr>
80      &lt;td>\${100.0 eq 100}&lt;/td>
81      &lt;td>${100.0 eq 100}&lt;/td>
82    &lt;/tr>
83    &lt;tr>
84      &lt;td>\${(10*10) != 100}&lt;/td>
85      &lt;td>${(10*10) != 100}&lt;/td>
86    &lt;/tr>
87    &lt;tr>
88      &lt;td>\${(10*10) ne 100}&lt;/td>
89      &lt;td>${(10*10) ne 100}&lt;/td>
90    &lt;/tr>
91  &lt;/table>
92      &lt;/code>
93      &lt;br>
94      &lt;u>&lt;b>Alphabetic&lt;/b>&lt;/u>
95      &lt;code>
96        &lt;table border="1">
97          &lt;thead>
98      &lt;td>&lt;b>EL Expression&lt;/b>&lt;/td>
99      &lt;td>&lt;b>Result&lt;/b>&lt;/td>
100    &lt;/thead>
101    &lt;tr>
102      &lt;td>\${'a' &amp;lt; 'b'}&lt;/td>
103      &lt;td>${'a' &lt; 'b'}&lt;/td>
104    &lt;/tr>
105    &lt;tr>
106      &lt;td>\${'hip' &amp;gt; 'hit'}&lt;/td>
107      &lt;td>${'hip' > 'hit'}&lt;/td>
108    &lt;/tr>
109    &lt;tr>
110      &lt;td>\${'4' &amp;gt; 3}&lt;/td>
111      &lt;td>${'4' > 3}&lt;/td>
112    &lt;/tr>
113  &lt;/table>
114      &lt;/code>
115    &lt;/blockquote>
116  &lt;/body>
117&lt;/html>
118</pre></body></html>
Note: See TracBrowser for help on using the repository browser.