java web中 EL表达式的相关案例:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
String abc="ABC";
String xyz="XYZ";
//原因是没有把abc放到作用域里
pageContext.setAttribute("abc", xyz);
pageContext.setAttribute("xyz", abc);
session.setAttribute("abc", "abcabcabc");
request.setAttribute("aaa", "requestAAA");
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
${sessionScope.abc }<br>${pageScope.xyz}<br>${aaa}
<%
//request.getRequestDispatcher("p12260.jsp").forward(request, response);
//request.getRequestDispatcher("p12260.jsp?www=www666").forward(request, response);
request.getRequestDispatcher("p12260.jsp?www=www666&www=www777").forward(request, response);
%>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
${sessionScope.abc }<br>${pageScope.xyz}<br>${aaa}<br>${param.www }<br>
<c:forEach items="${paramValues.www}" var="u">
Item <c:out value="${u}"/><p>
</c:forEach>
</body>
</html>