${expr}
expr: 표현언어가 정의한 문법에 따라 값을 표현하는 식
<jsp:include page="/module/${skin.id}/header.jsp" flush="true" />
<b>${sessionScope.member.id}</b>님 환영합니다.
${<표현1>.<표현2>}
또는 gt
= 또는 ge
<%@ page isELignored = "true"%>
(디폴트 값이 false로 EL 인식상태)<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
pageContext.setAttribute("p1", "page scope value");
request.setAttribute("r1", "request scope value");
session.setAttribute("s1", "session scope value");
application.setAttribute("a1", "application scope value");
%>
<html>
<head>
<title>Title</title>
</head>
<body>
<!--JSP로 출력하는 경우-->
pageContext.getAttribute("p1") : <%=pageContext.getAttribute("p1")%> <br>
<!--EL로 출력하는 경우-->
pageContext.getAttribute("p1") : ${pageScope.p1} <br>
request.getAttribute("r1") : ${requestScope.r1} <br>
session.getAttribute("s1") : ${sessionScope.s1} <br>
application.getAttribute("a1") : ${applicationScope.a1} <br>
pageContextt.getAttribute("p1") : ${p1} <br> <!--key가 겹치지 않는다면 이렇게도 가능, 근데 명시적이지 않음..-->
</body>
</html>
pageContext.getAttribute("p1") : page scope value
pageContext.getAttribute("p1") : page scope value
request.getAttribute("r1") : request scope value
session.getAttribute("s1") : session scope value
application.getAttribute("a1") : application scope value
pageContextt.getAttribute("p1") : page scope value
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% request.setAttribute("k", 10); %>
<% request.setAttribute("m", true); %>
<html>
<head>
<title>Title</title>
</head>
<body>
<h3>EL연산</h3>
k: ${k} <br>
k + 5 : ${k + 5} <br>
k * 5 : ${k * 5} <br>
k / 5 : ${k / 5} <br>
<h3>EL비교논리연산</h3>
k : ${k} <br>
k > 5 : ${k>5} <br>
k < 5 : ${k<5} <br>
m : ${m} <br>
!m : ${!m} <br>
</body>
</html>
EL연산
k: 10
k + 5 : 15
k * 5 : 50
k / 5 : 2.0
EL비교논리연산
k : 10
k > 5 : true
k < 5 : false
m : true
!m : false
<%@ page isELIgnored="true" %>
EL연산
k: ${k}
k + 5 : ${k + 5}
k * 5 : ${k * 5}
k / 5 : ${k / 5}
EL비교논리연산
k : ${k}
k > 5 : ${k>5}
k < 5 : ${k<5}
m : ${m}
!m : ${!m}
EL이 해석되지 않고 그대로 문자로 나온다.