[66] | 1 | <html><body><pre> |
---|
| 2 | <!-- |
---|
| 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 | <html> |
---|
| 19 | <head> |
---|
| 20 | <title>JSP 2.0 Expression Language - Basic Comparisons</title> |
---|
| 21 | </head> |
---|
| 22 | <body> |
---|
| 23 | <h1>JSP 2.0 Expression Language - Basic Comparisons</h1> |
---|
| 24 | <hr> |
---|
| 25 | This example illustrates basic Expression Language comparisons. |
---|
| 26 | The following comparison operators are supported: |
---|
| 27 | <ul> |
---|
| 28 | <li>Less-than (&lt; or lt)</li> |
---|
| 29 | <li>Greater-than (&gt; or gt)</li> |
---|
| 30 | <li>Less-than-or-equal (&lt;= or le)</li> |
---|
| 31 | <li>Greater-than-or-equal (&gt;= or ge)</li> |
---|
| 32 | <li>Equal (== or eq)</li> |
---|
| 33 | <li>Not Equal (!= or ne)</li> |
---|
| 34 | </ul> |
---|
| 35 | <blockquote> |
---|
| 36 | <u><b>Numeric</b></u> |
---|
| 37 | <code> |
---|
| 38 | <table border="1"> |
---|
| 39 | <thead> |
---|
| 40 | <td><b>EL Expression</b></td> |
---|
| 41 | <td><b>Result</b></td> |
---|
| 42 | </thead> |
---|
| 43 | <tr> |
---|
| 44 | <td>\${1 &lt; 2}</td> |
---|
| 45 | <td>${1 < 2}</td> |
---|
| 46 | </tr> |
---|
| 47 | <tr> |
---|
| 48 | <td>\${1 lt 2}</td> |
---|
| 49 | <td>${1 lt 2}</td> |
---|
| 50 | </tr> |
---|
| 51 | <tr> |
---|
| 52 | <td>\${1 &gt; (4/2)}</td> |
---|
| 53 | <td>${1 > (4/2)}</td> |
---|
| 54 | </tr> |
---|
| 55 | <tr> |
---|
| 56 | <td>\${1 &gt; (4/2)}</td> |
---|
| 57 | <td>${1 > (4/2)}</td> |
---|
| 58 | </tr> |
---|
| 59 | <tr> |
---|
| 60 | <td>\${4.0 &gt;= 3}</td> |
---|
| 61 | <td>${4.0 >= 3}</td> |
---|
| 62 | </tr> |
---|
| 63 | <tr> |
---|
| 64 | <td>\${4.0 ge 3}</td> |
---|
| 65 | <td>${4.0 ge 3}</td> |
---|
| 66 | </tr> |
---|
| 67 | <tr> |
---|
| 68 | <td>\${4 &lt;= 3}</td> |
---|
| 69 | <td>${4 <= 3}</td> |
---|
| 70 | </tr> |
---|
| 71 | <tr> |
---|
| 72 | <td>\${4 le 3}</td> |
---|
| 73 | <td>${4 le 3}</td> |
---|
| 74 | </tr> |
---|
| 75 | <tr> |
---|
| 76 | <td>\${100.0 == 100}</td> |
---|
| 77 | <td>${100.0 == 100}</td> |
---|
| 78 | </tr> |
---|
| 79 | <tr> |
---|
| 80 | <td>\${100.0 eq 100}</td> |
---|
| 81 | <td>${100.0 eq 100}</td> |
---|
| 82 | </tr> |
---|
| 83 | <tr> |
---|
| 84 | <td>\${(10*10) != 100}</td> |
---|
| 85 | <td>${(10*10) != 100}</td> |
---|
| 86 | </tr> |
---|
| 87 | <tr> |
---|
| 88 | <td>\${(10*10) ne 100}</td> |
---|
| 89 | <td>${(10*10) ne 100}</td> |
---|
| 90 | </tr> |
---|
| 91 | </table> |
---|
| 92 | </code> |
---|
| 93 | <br> |
---|
| 94 | <u><b>Alphabetic</b></u> |
---|
| 95 | <code> |
---|
| 96 | <table border="1"> |
---|
| 97 | <thead> |
---|
| 98 | <td><b>EL Expression</b></td> |
---|
| 99 | <td><b>Result</b></td> |
---|
| 100 | </thead> |
---|
| 101 | <tr> |
---|
| 102 | <td>\${'a' &lt; 'b'}</td> |
---|
| 103 | <td>${'a' < 'b'}</td> |
---|
| 104 | </tr> |
---|
| 105 | <tr> |
---|
| 106 | <td>\${'hip' &gt; 'hit'}</td> |
---|
| 107 | <td>${'hip' > 'hit'}</td> |
---|
| 108 | </tr> |
---|
| 109 | <tr> |
---|
| 110 | <td>\${'4' &gt; 3}</td> |
---|
| 111 | <td>${'4' > 3}</td> |
---|
| 112 | </tr> |
---|
| 113 | </table> |
---|
| 114 | </code> |
---|
| 115 | </blockquote> |
---|
| 116 | </body> |
---|
| 117 | </html> |
---|
| 118 | </pre></body></html> |
---|