<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<c:set var="a" value="20" />
<!-- request.setAttribute("b",30) --> //setAttribue에 담아서 뭐.뭐 이렇게 안나오는거임
<c:set var="b" value="30" scope="request" /> //같은 이름일 경우만 scope 명시
<!-- session.setAttribute("c",40) -->
<c:set var="c" value="40" scope="session" /> //set은 특정범위만 지정해주는 역할
<!-- application.setAttribute("d",50) -->
<c:set var="d" value="50" scope="application" />
<h2>jstl,el을 이용한 출력</h2>
a=
<c:out value="${a }" />
<br> b=
<c:out value="${b }" />
<br> c=
<c:out value="${c }" />
<br> d=
<c:out value="${d }" />
<br>
<hr>
a=
${a }
<br> b=
${b }
<br> c=
${c }
<br> d=
${d }
</body>
</html>
'🎵JSP' 카테고리의 다른 글
The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 에러잡기(jsp생성직후에러잡기) (0) | 2023.02.14 |
---|---|
[JSP] 스크립트tag, el태그, jstl태그 (0) | 2023.02.13 |
[JSP]EL태그 (0) | 2023.02.13 |
[JSP] Bean에 담아 게시판 만들기 (0) | 2023.02.10 |
[JSP]Session (0) | 2023.02.09 |
댓글