본문 바로가기

JSP

JSP 레이아웃 include

jsp04.zip

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//-----------------------------------main.css------------------------------------------------
@charset "UTF-8";
/* 모든요소의 마진을 제거 */
*{ margin: 0; }
#main_box{
    
    width: 800px;
    height: 600px;
    margin: auto; /* 화면의 중앙배치 */
    background-color: #000;
}
#header{
    width: 100%;
    height: 120px;
    background-color: #000;
    color:#fff;
}
#aside{
    width: 30%;
    height: 380px;
    float: left;
    background-color: #000;
}
#content{
    width: 70%;
    min-height: 380px; /* 최소높이 */
    height: auto;
    background-color: #000;
    float: left;
}
#footer {
    width:100%;
    height:100px;
    clear: both; /* float 속성해제 */    
    background-color:#ffss33;
    
}
#footer_content {
    margin:10px;
    padding: 12px;
    font-family: 휴먼옛체;
    font-size: 10pt;
    color:#666;
}
#footer_content a {
    text-decoration: none;
    color:#fff;
}
#footer_content a:hover {
    color: yellow;
}
#title{
    margin-top:10px;
    text-align: center;
}
//-----------------------------------menu.css------------------------------------------------
@charset "UTF-8";
#main_menu {
    list-style: none;
    margin: 20px;
}
#main_menu li {
    display: inline-block;
}
#main_menu li a {
    display: inline-block;
    width: 150px;
    border: 1px solid red;
    text-decoration:none;
    text-align: center;
    font-size: 16pt;
    margin-left: 50px;
    color:#fff;    
    font-weight: bold;
}
#main_menu li a:hover {
    color: #000;
    border-color: blue;
    background:#fff;
}
/* 서브메뉴 스타일 */
.submenu_style {
    list-style: none;
}
.submenu_style li a {
    display:block;
    text-decoration:none;
    color:#fff;    
    margin-top:50px;
    width:150px;
    font-size: 14pt;
}
.submenu_style li a:hover {
    color:yellow;
    font-weight: bold;
}
 
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//-----------------------------------header.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>
    <h1 id="title">::::: A강의 쇼핑몰 :::::</h1>
    <!-- 주메뉴 -->
    <%@include file="../menu/main_menu.jsp" %>
    
</body>
</html>
 
 
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//-----------------------------------footer.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>
    <div id="footer_content">
        (주)인크레파스 A강의실 <a href="#">개인정보관리정책</a><br>
        대표자 : 홍대표<br>
        주   소 : 서울시 구로구 구로3동<br>
        관리자 : 홍관리        전화) 010-111-2345 
    </div>
</body>
</html>
 
 
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//-----------------------------------submenu_company.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>
<ul id="main_menu">
    <li><a href="main_company.jsp">회사소개</a></li>
    <li><a href="main_product.jsp">상품소개</a></li>
    <li><a href="main_customer.jsp">고객센터</a></li>
</ul>
</body>
</html>
 
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//-----------------------------------submenu_product.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>
    <!-- 회사소개 서브메뉴 -->
    <ul class="submenu_style">
        <li><a href="#">소개 및 인사말</a></li>
        <li><a href="#">연혁</a></li>
        <li><a href="#">오시는 길</a></li>
    </ul>
</body>
</html>
 
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//-----------------------------------submenu_customer.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>
    <!-- 고객센터 서브메뉴 -->
    <ul class="submenu_style">
        <li><a href="#">공지사항</a></li>
        <li><a href="#">자주하는 질문</a></li>
        <li><a href="#">고객게시판</a></li>
    </ul>
</body>
</html>
 
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//-----------------------------------main_product.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>
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/menu.css" />
<style type="text/css">
    #aside{background:silver;}
</style>
</head>
<body>
    <div id="main_box">
        <div id="header">
            <%@include file="header/header.jsp" %>
        </div>    
        <div id="aside">
            <%@include file="menu/submenu_product.jsp" %>
        </div>    
        <div id="content">main_product</div>    
        <div id="footer">
            <%@include file="footer/footer.jsp" %>
        </div>    
    </div>
</body>
</html>
 
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//-----------------------------------main_customer.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>
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/menu.css" />
<style type="text/css">
    #aside{background:olive;}
</style>
</head>
<body>
    <div id="main_box">
        <div id="header">
            <%@include file="header/header.jsp" %>
        </div>    
        <div id="aside">
            <%@include file="menu/submenu_customer.jsp" %>
        </div>    
        <div id="content">main_costomer</div>    
        <div id="footer">
            <%@include file="footer/footer.jsp" %>
        </div>    
    </div>
</body>
</html>
 
 
cs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//-----------------------------------main_company.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>
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/menu.css" />
</head>
<body>
    <div id="main_box">
        <div id="header">
            <%@include file="header/header.jsp" %>
        </div>    
        <div id="aside">
            <%@include file="menu/submenu_company.jsp" %>
        </div>    
        <div id="content">main_company</div>    
        <div id="footer">
            <%@include file="footer/footer.jsp" %>
        </div>    
    </div>
</body>
</html>
 
cs