测试EL表达式


普通字符器

hello(jsp表达式):null
hello( el表达式):

内置对象范围

内置对象范围: pageScope < requestScope < sessionScope < applicationScope

hello(el表达式,范围pageScope):
hello(el表达式,范围requestScope):
hello(el表达式,范围sessionScope):
hello(el表达式,范围applicationScope):
如果不指定范围,它的搜索顺序为pageScope~applicationScope):

结构,采用.或[]进行导航,或称为存取器

姓名:
年龄:
所属组:

姓名:
年龄:
所属组:

map

map.11:
map.12:
map.13:
map.14:
map.15:

字符串数组,采用[]下标

strArray[0]:
strArray[1]:
strArray[2]:
strArray[3]:

对象数组,采用[]下标

users[3].姓名:
users[5].姓名:

List,采用[]下标

userList[4].姓名:
userList[6].姓名:

el表达式对运算符的支持

1 + 1 = 2
10 / 5 = 2.0
10 div 5 = 2.0
10 % 3 = 1
10 mod 3 = 1

测试empty 判断是为空值

v1:true
v2:true
v3:true
v4:true
v5:true
判断 request.setAttribute("用户名","李超宇") 是否为空:false
判断 request.setAttribute("用户名1","") 是否为空:true
判断 request.setAttribute("用户名2",null) 是否为空:true