<jsp:include> 액션 태그의 기본 사용 방법은 다음과 같다.

 

<jsp:include page="포함할 페이지" flush="false"/>

 

▶page - 포함할 jsp페이지

flush - 지정한 jsp페이지를 실행하기 전에 출력 버퍼를 플러시 할지의 여부를 지정한다. true이면 출력 버퍼를 플러시하고, false이면 하지 않는다.

 

 

샘플코드

 

 main.jsp

 <%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>main.jsp</title>
</head>
<body>
 <jsp:include page="sub.jsp" flush="false"/>
 
 include 이후의 내용
</body>
</html>

 

 sub.jsp

 <%@ page contentType="text/html; charset=utf-8"%>
<br>
sub.jsp에서 생성한 내용
<br>

 

 

결과화면

 

+ Recent posts