EL中运算符: 
   ==/eq
   !=/ne
   </lt
   >/gt
   <=/le
   >=/ge
   &&/and
   ||/or
   !/not
   //div
   %/mod

 1<h1>测试EL表达式</h1><br>
 2    <hr>
 3    <li>普通字符串</li><br>
 4    hello(jsp脚本):<%=request.getAttribute("hello"%><br>
 5    hello(el表达式,el表达式的使用方法$和{}):${hello }<br>
 6    hello(el表达式,el的隐含对象pageScope,requestScope,sessionScope,applicationScope,<br> 如果未指定scope,它的搜索顺序为pageScope~applicationScope):${requestScope.hello }<br>
 7    hello(el表达式,scope=session):${sessionScope.hello }<br>
 8    <p>
 9    <li>结构,采用.进行导航,也称存取器</li><br>
10    姓名:${user.username }<br>
11    年龄:${user.age }<br>
12    所属组:${user.group.name }<br>
13    <p>
14    <li>输出map,采用.进行导航,也称存取器</li><br>
15    mapvalue.key1:${mapvalue.key1 }<br>
16    mapvalue.key2:${mapvalue.key2 }<br>
17    <p>
18    <li>输出数组,采用[]和下标</li><br>
19    strarray[2]:${strarray[1] }<br>
20    <p>
21    <li>输出对象数组,采用[]和下标</li><br>
22    userarray[3].username:${users[2].username }<br>
23    <p>
24    <li>输出list,采用[]和下标</li><br>
25    userlist[5].username:${userlist[4].username }<br>
26    <p>
27    <li>el表达式对运算符的支持</li><br>
28    1+2=${1+2 }<br>
29    10/5=${10/5 }<br>
30    10 div 5=${10 div 5 }<br>
31    10%3=${10 % 3 }<br>
32    10 mod 3=${10 mod 3 }<br>
33    <!--
34         ==/eq
35         !=/ne 
36         </lt
37         >/gt
38         <=/le
39         >=/ge
40         &&/and
41         ||/or
42         !/not
43         //div
44         %/mod
45     -->  
46     <li>测试empty</li><br>
47     value1:${empty value1 }<br>
48     value2:${empty value2 }<br>
49     value3:${empty value3 }<br>
50     value4:${empty value4 }<br>
51     value4:${!empty value4 }<br>
 posted on 2009-08-13 13:30  将军  阅读(265)  评论(0编辑  收藏  举报