EL(Expression Language)3

oyeon·2021년 1월 11일
0

실습1 <%@ page isELIgnored = "false" %>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page isELIgnored = "false" %>
<%
request.setAttribute("k", 10); 
request.setAttribute("m", true);
%>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
k : ${k }<br>
k + 5 : ${ k + 5 } <br>
k - 5 : ${ k - 5 } <br>
k * 5 : ${ k * 5 } <br>
k / 5 : ${ k div 5 } <br>

k : ${k } <br>
m : ${m } <br>

k > 5 : ${ k > 5 } <br>
k < 5 : ${ k < 5 } <br>
k <= 10 : ${ k <= 10 } <br>
k >= 10 : ${ k >= 10 } <br>

m : ${ m } <br>
!m : ${ !m } <br>
</body>
</html>

결과

실습2 <%@ page isELIgnored = "true" %>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page isELIgnored = "true" %>
<%
request.setAttribute("k", 10); 
request.setAttribute("m", true);
%>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
k : ${k }<br>
k + 5 : ${ k + 5 } <br>
k - 5 : ${ k - 5 } <br>
k * 5 : ${ k * 5 } <br>
k / 5 : ${ k div 5 } <br>

k : ${k } <br>
m : ${m } <br>

k > 5 : ${ k > 5 } <br>
k < 5 : ${ k < 5 } <br>
k <= 10 : ${ k <= 10 } <br>
k >= 10 : ${ k >= 10 } <br>

m : ${ m } <br>
!m : ${ !m } <br>
</body>
</html>

결과

profile
Enjoy to study

0개의 댓글