Include Directive

    include 디렉티브 <%@ include file="포함될 파일의 url" %> 
    
    : 공통적으로 포함될 내용을 가진 파일을 해당 JSP 페이지 내에 삽입하는 기능을 제공
    
    ​
    
    TOP.jsp
    
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    
    	<h1>top.jsp</h1>
    
    includeDirective.jsp(Main)
    
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>includeDirective</title>
    </head>
    <body>
    	<%@ include file = "top.jsp" %><hr>
    	<h1>includeDirective.jsp</h1><hr>
    	<%@ include file = "bottom.jsp" %>
    
    </body>
    </html>
    Bottom.jsp
    
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    
    	<h1>bottom.jsp</h1>
    

    'JSP' 카테고리의 다른 글

    response 내장객체 - sendRedirect  (0) 2020.11.14
    request 내장객체  (0) 2020.11.14
    Page Directive - Info  (0) 2020.11.14
    PageDirective - import  (0) 2020.11.14
    JSP 선언문, 스트링트릿, 표현식  (0) 2020.11.14

    댓글