본문 바로가기

JSP/기본다지기

JSP 6일차 필기 (Template)

페이지 출력 화면



main부분에는 프로젝트의 여러 정보를 표시해 보았다.


여기에서 URL이란, 외부에서 접근하는 경로를 나타낸 것이고,


URI란 프로젝트의 주소를 말한다.

main.jsp

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
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Template를 알아보자.</title>
<style type="text/css">
    body{
        font-family: Meiryo, 굴림;
        text-align: center;
        background-color: lightblue;
    }
    #maindiv>.w3s>a:LINK,
    #maindiv>.w3s>a:ACTIVE,
    #maindiv>.w3s>a:VISITED
    {
        color: #dead00;
        text-decoration: none;
    }
    #maindiv>.w3s>a:HOVER{
        color:red;
        background:cyan;
    }
</style>
</head>
<body>
<!-- "명시적"으로 머리에 있는 Template으로 지정 -->
    <header>
        <%@ include file="./layout/header.jsp" %>
    </header>
    <div id="mainContents">
        <h1>
            requestオブジェクトの情報を確認する.
        </h1>
        <div class="contents container">
            <!-- class는 html에서 중복가능, 한 태그에 여러 개 지정 가능 -->
            <p><b style = 'color:blue'>Context Path:</b><%=request.getContextPath() %></p>
            <p><b style = 'color:blue'>要求メソッド :</b><%=request.getMethod() %></p>
            <p><b style = 'color:blue'>要求した url:</b><%=request.getRequestURL() %></p>
            <p><b style = 'color:blue'>要求した uri:</b><%=request.getRequestURI() %></p>
            <p><b style = 'color:blue'>Serverの名前:</b><%=request.getServerName() %></p>
            <p><b style = 'color:blue'>Protocol:</b><%=request.getProtocol() %></p>
            <!-- 
            url : 외부에서 접근하는 주소
            uri : 프로젝트 주소
             -->
        </div>
    </div>
    <footer><!-- 최근에 등장한 태그(header, footer) -->
        <%@ include file="./layout/footer.jsp" %>
        <div id="maindiv">
            <h3 class="w3s">
                <a href="http://www.w3schools.com/" target="_blank">www.w3schools.com</a><br>
                <a href="http://cbts.tistory.com/" target="_blank">IT日記帳</a>
            </h3>
        </div>
    </footer>
</body>
</html>
cs

footer 부분에는 회사 정보와, 이용약관, 개인정보 취급방침, 고객센터 등을 포함시켰다.


footer.jsp

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
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
    body{
        font-family: Meiryo, 굴림;
        text-align: center;
    }
    #footer>ul{
        list-style:none;
    }
</style>
</head>
<body>
    <!-- 회사정보 -->
    <hr>
    <div id="footer">
        <ul>
            <li><a href="#">利用規約</a></li>
            <li><a href="#">個人情報の取り扱い</a></li>
            <li><a href="#">お問い合わせ</a></li>
        </ul>
        <address>
            <a href="#"><b>JSP_LESSON</b></a>
            <em>Copyright ⓒ</em><a href="#">JSP_LESSON Corp.</a>
            <span>All Right Reserved</span>
        </address>
    </div>
</body>
</html>
cs


'JSP > 기본다지기' 카테고리의 다른 글

JSP 6일차 필기 (Session을 이용한 로그인)  (0) 2016.10.25
JSP 6일차 필기 (Session)  (0) 2016.10.25
JSP 5일차 필기 (Template)  (0) 2016.10.24
JSP 5일차 필기 (Dispatcher)  (0) 2016.10.24
JSP 4일차 필기 (Redirect)  (0) 2016.10.21