728x90
2-8. Include2
index.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<style>
ul{
list-style: none;
float: left;
}
li{
margin: 10px;
}
</style>
<ul>
<li><a href="main.jsp">MAIN</a></li>
<li><a href="a.jsp">A</a></li>
<li><a href="b.jsp">B</a></li>
</ul>
<%-- 정적인 페이지 [include file] dependency ex) 바닥글, 유지보수 적은 것--%>
<%-- 동적인 페이지 [include page] dependency 유지보수가 더 필요한 것--%>
main.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:include page="index.jsp"/>
<h1>MAIN</h1>
<a href="a.jsp"> to a </a>
a.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:include page="index.jsp"/>
<h1>A</h1>
<a href="main.jsp"> to main </a>
b.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><jsp:include page="index.jsp"/>
<h1>B</h1>
<a href="main.jsp"> to main </a>
728x90
'WEB > JSP' 카테고리의 다른 글
[JSP] ch03-02. Request (0) | 2017.11.13 |
---|---|
[JSP] ch03-01. FOR문 (0) | 2017.11.13 |
[JSP] ch02-07. Include (0) | 2017.11.13 |
[JSP] ch02-06. Target (0) | 2017.11.09 |
[JSP] ch02-05.Pameter(파라미터) 2 (0) | 2017.11.02 |
댓글