1、EL概述和基本语法
EL表达式:expression language 表达式语言,要简化jsp中java代码开发。它不是一种开发语言,是jsp中获取数据的一种规范

2、EL的具体功能
a、获取数据
EL表达式只能获取存在4个作用域中的数据
${u}原理: pageContext.findAttribute("u");
url?name=tom ${param.name}
EL获取对于null这样的数据,在页面中表现为空字符串
${u.name} == u.getName()方法
点(.) 运算符相当于调了getter方法,点后页面跟的是属性名。


[ ]运算符:点能做的,它也能做; 它能做的,点不一定能做
${student.name}== ${student['name']} == ${student["name"]}

b、运算
empty:判断null,空字符串和没有元素的集合(即使集合对象本身不为null)都返回true


三元运算符:


c、隐式对象:11个

网友评论