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>
View Code

相关文章:

  • 2021-05-19
  • 2021-09-25
  • 2021-11-12
  • 2022-03-06
  • 2022-03-08
  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
猜你喜欢
  • 2021-12-18
  • 2021-06-05
  • 2021-11-19
  • 2021-04-07
  • 2022-01-28
  • 2021-11-29
相关资源
相似解决方案