WEB/JSP

[JSP] ch02-07. Include

밍글링글링 2017. 11. 13.
728x90

2-7. Include

index.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<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>
 

main.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="index.jsp"%>
<h1>MAIN</h1>
<a href="main.jsp">to main</a>
 
a.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="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"%>
<%@ include file="index.jsp"%>
<h1>B</h1>
<a href="main.jsp">to main</a>
 

 

 

728x90

'WEB > JSP' 카테고리의 다른 글

[JSP] ch03-01. FOR문  (0) 2017.11.13
[JSP] ch02-08. Include2  (0) 2017.11.13
[JSP] ch02-06. Target  (0) 2017.11.09
[JSP] ch02-05.Pameter(파라미터) 2  (0) 2017.11.02
[JSP] ch02-04. Parameter(파라미터)  (0) 2017.11.01

댓글