home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-tomcat-addon-1.4.9-installer.exe / basic-comparisons.jsp < prev    next >
Encoding:
Text File  |  2004-08-28  |  2.8 KB  |  116 lines

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