EL - Expression Language
一. 基本语法
EL表达式以 ${} 的形式访问变量的值
1. "." 和 "[]" 运算符
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-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=UTF-8"> <title>Insert title here</title> </head> <body> <% String token = "push"; %> age: ${sessionScope.customer[age]} } key: ${param["user.key"]} } token: ${requestScope[token]} </body> </html>
2. EL中得隐含对象
3. EL可以进行自动类型转换
时间: 2024-11-05 02:36:58