04include.jsp์ ์ฝ๋๋ด์ฉ
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
04include
include ์
<%@include file="04included.jsp" %>
include ํ
<%=includedA %>
</body>
</html>
04included.jsp์ ์ฝ๋๋ด์ฉ
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
๋๋ included๋ jspํ์ด์ง
<%
int includedA = 50;
%>
</body>
</html>
์ถ๋ ฅ๋ด์ฉ
<%@include%>๋????
์ค๋ช
- ์๋ฒ์ธก include ๋ผ๊ณ ์๊ฐํ๋ฉด ๋๋ค ์ฆ ์์ค ์คํ์ ์ include๊ฐ ๋๋ค๊ณ ๋ณด์
- ์์ค ์คํ์ ํฌํจ๋จ์ผ๋ก ๋ณ์๋ฅผ ๊ฐ์ด ์ฌ์ฉํ ์ ์๋ค
- ๋์ ์ผ๋ก ํ์ด์ง ํ ๋น์ ํ ์๊ฐ ์๋ค. ์ฆ ์ ์ ์ธ ํ์ด์ง์ ํ์ฉ๋๋ค๋ ๊ฒ !
์์ฑ
- file : ํฌํจ๋ ํ์ด์ง๋ฅผ ๋ช ์ํ๋ค
jsp:include VS include file ์ฐจ์ด๋ฅผ ์ ์๊ฐํ ๊ฒ ! ํ์ฉํ๋ ๊ณณ์ด ๋ค๋ฅผํ ๋ !
'๐ Today I Learned(๊ฐ๋ฐ์ธ์ดํ์ต) > JSP' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Day05(cookie01) (0) | 2021.10.08 |
---|---|
Day05(javaBean) (0) | 2021.10.08 |
Day04(jsp:forward) (0) | 2021.10.07 |
Day04(jsp:include๋์ ํ์ด์งํ ๋น) (0) | 2021.10.07 |
Day04(pageModule) (0) | 2021.10.07 |