标签:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.util.*,day_5_8.*"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <% pageContext.setAttribute("name", "zhangsan"); request.setAttribute("rname", "request"); session.setAttribute("sname", "session"); application.setAttribute("aname", "application"); List<Student> list=new ArrayList(); Student stu1=new Student(); stu1.setId(1001); stu1.setAge(15); stu1.setName("liming"); Student stu2=new Student(); stu2.setId(1002); stu2.setAge(20); stu2.setName("wangwu"); list.add(stu1); list.add(stu2); request.setAttribute("list", list); %> <h3>EL表达式</h3> ${文字 }<br> 1+1=${1+1 }<br> 10/2=${10/2 }<br> 10!=4 正确吗${10!=4 }<br> true&&false${true&&false }<br> "null"这是一个空字符串吗?${empty "null" } <h3>EL隐式对象</h3> ${pageContext.request.contextPath }<br> ${pageScope.name}<br> ${requestScope.rname }<br> ${sessionScope.sname }<br> ${applicationScope.aname }<br> ${list[0][‘id‘] } ${list[0][‘id‘] }<br> ${param.el } </body> </html>
标签:
原文地址:http://my.oschina.net/u/2356966/blog/412383