본문 바로가기
Developer/HTML & JSP & CSS

[JSP] HTTP에러 완전정복

by 순수한소년 2017. 11. 1.
728x90
반응형
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="/abc/abcError/jquery-confirm.css" rel="stylesheet" />
 
<style type="text/css" media="screen">
@charset "utf-8";
    a.moveBack, a.moveBack img {
        display: inline-block;
        padding-top: 10px;
        border-top: 10px;
        border-bottom: 10px;
    }
    
    a.moveBack:hover {
        display: inline-block;
        padding-top: 10px;
        border-bottom: 10px solid #5faee3;
    }
    
    a.moveWork, a.moveWork img {
        display: inline-block;
        border-top: 10px solid rgba(0, 0, 0, 0);
        border-bottom: 10px solid rgba(0, 0, 0, 0);
    }
    
    a.moveWork:hover {
        display: inline-block;
        border-bottom: 10px solid #5faee3;
    }
    
</style>
 
<script type="text/javascript" src="/abc/abcError/jquery.min.js"></script>
<script type="text/javascript" src="/abc/abcError/jquery-confirm.js"></script>
 
 
<script type="text/javascript">
    $(document).ready(function() {
 
        var httpRequest = null;
        var link = document.location.href;
        var hostname = document.location.hostname.toLowerCase();
        var port = document.location.port;
        var protocol = document.location.protocol;
 
        var requesthost = hostname.indexOf('work');
 
        var strHtml = "";
        strHtml += "<tr><td><font color=#fffff> link:          " + link + "</font></td></tr>"
        strHtml += "<tr><td><font color=#fffff> hostname:      " + hostname + "</font></td></tr>"
        strHtml += "<tr><td><font color=#fffff> port:          " + port + "</font></td></tr>"
        strHtml += "<tr><td><font color=#fffff> protocol:      " + protocol + "</font></td></tr>"
 
        $('#httpStatusList').html(strHtml);
 
        //         호출하신 url에 work가 존재하여 농산업인력센터로 이동합니다. 이동하시겠습니까?
        //         if (requesthost != '-1') {
        //             alert("존재합니다.");
        //         } else {
        //             alert("존재하지 않습니다.");
        //         }
        sendRequest(link);
    });
 
    function sendRequest(url) {
        var client = new XMLHttpRequest();
        client.onreadystatechange = function() {
            if (client.status == "200")
                console.log(client.status + " : 200(성공): 서버가 요청을 제대로 처리했다는 뜻이다. 이는 주로 서버가 요청한 페이지를 제공했다는 의미로 쓰인다.");
            if (client.status == "201")
                console.log(client.status + " : 201(작성됨): 성공적으로 요청되었으며 서버가 새 리소스를 작성했다.");
            if (client.status == "202")
                console.log(client.status + " : 202(허용됨): 서버가 요청을 접수했지만 아직 처리하지 않았다.");
            if (client.status == "203")
                console.log(client.status + " : 203(신뢰할 수 없는 정보): 서버가 요청을 성공적으로 처리했지만 다른 소스에서 수신된 정보를 제공하고 있다.");
            if (client.status == "204")
                console.log(client.status + " : 204(콘텐츠 없음): 서버가 요청을 성공적으로 처리했지만 콘텐츠를 제공하지 않는다.");
            if (client.status == "205")
                console.log(client.status + " : 205(콘텐츠 재설정): 서버가 요청을 성공적으로 처리했지만 콘텐츠를 표시하지 않는다. 204 응답과 달리 이 응답은 요청자가 문서 보기를 재설정할 것을 요구한다(예: 새 입력을 위한 양식 비우기).");
            if (client.status == "206")
                console.log(client.status + " : 206(일부 콘텐츠): 서버가 GET 요청의 일부만 성공적으로 처리했다.");
            if (client.status == "207")
                console.log(client.status + " : 207(다중 상태, RFC 4918)");
            if (client.status == "208")
                console.log(client.status + " : 208(이미 보고됨, RFC 5842)");
            if (client.status == "226")
                console.log(client.status + " : 226 IM Used (RFC 3229)");
 
            if (client.status == "300")
                console.log(client.status + " : 300(여러 선택항목): 서버가 요청에 따라 여러 조치를 선택할 수 있다. 서버가 사용자 에이전트에 따라 수행할 작업을 선택하거나, 요청자가 선택할 수 있는 작업 목록을 제공한다.");
            if (client.status == "301")
                console.log(client.status + " : 301(영구 이동): 요청한 페이지를 새 위치로 영구적으로 이동했다. GET 또는 HEAD 요청에 대한 응답으로 이 응답을 표시하면 요청자가 자동으로 새 위치로 전달된다.");
            if (client.status == "302")
                console.log(client.status + " : 302(임시 이동): 현재 서버가 다른 위치의 페이지로 요청에 응답하고 있지만 요청자는 향후 요청 시 원래 위치를 계속 사용해야 한다.");
            if (client.status == "303")
                console.log(client.status + " : 303(기타 위치 보기): 요청자가 다른 위치에 별도의 GET 요청을 하여 응답을 검색할 경우 서버는 이 코드를 표시한다. HEAD 요청 이외의 모든 요청을 다른 위치로 자동으로 전달한다.");
            if (client.status == "304")
                console.log(client.status + " : 304(수정되지 않음): 마지막 요청 이후 요청한 페이지는 수정되지 않았다. 서버가 이 응답을 표시하면 페이지의 콘텐츠를 표시하지 않는다. 요청자가 마지막으로 페이지를 요청한 후 페이지가 변경되지 않으면 이 응답(If-Modified-Since HTTP 헤더라고 함)을 표시하도록 서버를 구성해야 한다.");
            if (client.status == "305")
                console.log(client.status + " : 305(프록시 사용): 요청자는 프록시를 사용하여 요청한 페이지만 액세스할 수 있다. 서버가 이 응답을 표시하면 요청자가 사용할 프록시를 가리키는 것이기도 하다.");
            if (client.status == "307")
                console.log(client.status + " : 307(임시 리다이렉션): 현재 서버가 다른 위치의 페이지로 요청에 응답하고 있지만 요청자는 향후 요청 시 원래 위치를 계속 사용해야 한다.");
            if (client.status == "308")
                console.log(client.status + " : 308(영구 리다이렉션, RFC에서 실험적으로 승인됨)");
 
            if (client.status == "400")
                console.log(client.status + " : (잘못된 요청): 서버가 요청의 구문을 인식하지 못했다.");
            if (client.status == "401")
                console.log(client.status + " : (권한 없음): 이 요청은 인증이 필요하다. 서버는 로그인이 필요한 페이지에 대해 이 요청을 제공할 수 있다. 상태 코드 이름이 권한 없음(Unauthorized)으로 되어 있지만 실제 뜻은 인증 안됨(Unauthenticated)에 더 가깝다.");
            if (client.status == "402")
                console.log(client.status + " : (결제 필요): 이 요청은 결제가 필요합니다.");
            if (client.status == "403")
                console.log(client.status + " : (금지됨): 서버가 요청을 거부하고 있다. 예를 들자면, 사용자가 리소스에 대한 필요 권한을 갖고 있지 않다. (401은 인증 실패, 403은 인가 실패라고 볼 수 있음)");
            if (client.status == "404")
                console.log(client.status + " : (찾을 수 없음): 서버가 요청한 페이지를 찾을 수 없다. 예를 들어 서버에 존재하지 않는 페이지에 대한 요청이 있을 경우 서버는 이 코드를 제공한다.");
            if (client.status == "405")
                console.log(client.status + " : (허용되지 않는 방법): 요청에 지정된 방법을 사용할 수 없다.");
            if (client.status == "406")
                console.log(client.status + " : (허용되지 않음): 요청한 페이지가 요청한 콘텐츠 특성으로 응답할 수 없다.");
            if (client.status == "407")
                console.log(client.status + " : (프록시 인증 필요): 이 상태 코드는 401(권한 없음)과 비슷하지만 요청자가 프록시를 사용하여 인증해야 한다. 서버가 이 응답을 표시하면 요청자가 사용할 프록시를 가리키는 것이기도 한다.");
            if (client.status == "408")
                console.log(client.status + " : (요청 시간초과): 서버의 요청 대기가 시간을 초과하였다.");
            if (client.status == "409")
                console.log(client.status + " : (충돌): 서버가 요청을 수행하는 중에 충돌이 발생했다. 서버는 응답할 때 충돌에 대한 정보를 포함해야 한다. 서버는 PUT 요청과 충돌하는 PUT 요청에 대한 응답으로 이 코드를 요청 간 차이점 목록과 함께 표시해야 한다.");
            if (client.status == "410")
                console.log(client.status + " : (사라짐): 서버는 요청한 리소스가 영구적으로 삭제되었을 때 이 응답을 표시한다. 404(찾을 수 없음) 코드와 비슷하며 이전에 있었지만 더 이상 존재하지 않는 리소스에 대해 404 대신 사용하기도 한다. 리소스가 영구적으로 이동된 경우 301을 사용하여 리소스의 새 위치를 지정해야 한다.");
            if (client.status == "411")
                console.log(client.status + " : (길이 필요): 서버는 유효한 콘텐츠 길이 헤더 입력란 없이는 요청을 수락하지 않는다.");
            if (client.status == "412")
                console.log(client.status + " : (사전조건 실패): 서버가 요청자가 요청 시 부과한 사전조건을 만족하지 않는다.");
            if (client.status == "413")
                console.log(client.status + " : (요청 속성이 너무 큼): 요청이 너무 커서 서버가 처리할 수 없다.");
            if (client.status == "414")
                console.log(client.status + " : (요청 URI가 너무 긺): 요청 URI(일반적으로 URL)가 너무 길어 서버가 처리할 수 없다.");
            if (client.status == "415")
                console.log(client.status + " : (지원되지 않는 미디어 유형): 요청이 요청한 페이지에서 지원하지 않는 형식으로 되어 있다.");
            if (client.status == "416")
                console.log(client.status + " : (처리할 수 없는 요청범위): 요청이 페이지에서 처리할 수 없는 범위에 해당되는 경우 서버는 이 상태 코드를 표시한다.");
            if (client.status == "417")
                console.log(client.status + " : (예상 실패): 서버는 Expect 요청 헤더 입력란의 요구사항을 만족할 수 없다.");
            if (client.status == "418")
                console.log(client.status + " : (I'm a teapot, RFC 2324)");
            if (client.status == "420")
                console.log(client.status + " : (Enhance Your Calm, 트위터)");
            if (client.status == "422")
                console.log(client.status + " : (처리할 수 없는 엔티티, WebDAV; RFC 4918)");
            if (client.status == "423")
                console.log(client.status + " : (잠김,WebDAV; RFC 4918)");
            if (client.status == "424")
                console.log(client.status + " : (실패된 의존성, WebDAV; RFC 4918)");
            if (client.status == "424")
                console.log(client.status + " : (메쏘드 실패, WebDAV)");
            if (client.status == "425")
                console.log(client.status + " : (정렬되지 않은 컬렉션, 인터넷 초안)");
            if (client.status == "426")
                console.log(client.status + " : (업그레이드 필요, RFC 2817)");
            if (client.status == "428")
                console.log(client.status + " : (전제조건 필요, RFC 6585)");
            if (client.status == "431")
                console.log(client.status + " : (요청 헤더 필드가 너무 큼, RFC 6585)");
            if (client.status == "444")
                console.log(client.status + " : (응답 없음, Nginx)");
            if (client.status == "449")
                console.log(client.status + " : (다시 시도, 마이크로소프트)");
            if (client.status == "450")
                console.log(client.status + " : (윈도 자녀 보호에 의해 차단됨, 마이크로소프트)");
            if (client.status == "451")
                console.log(client.status + " : (법적인 이유로 이용 불가, 인터넷 초안)");
            if (client.status == "451")
                console.log(client.status + " : (리다이렉션, 마이크로소프트)");
            if (client.status == "494")
                console.log(client.status + " : (요청 헤더가 너무 큼, Nginx)");
            if (client.status == "495")
                console.log(client.status + " : (Cert 오류, Nginx)");
            if (client.status == "496")
                console.log(client.status + " : (Cert 없음, Nginx)");
            if (client.status == "497")
                console.log(client.status + " : (HTTP to HTTPS, Nginx)");
            if (client.status == "499")
                console.log(client.status + " : (클라이언트가 요청을 닫음, Nginx)");
 
            if (client.status == "500")
                console.log(client.status + " : 500(내부 서버 오류): 서버에 오류가 발생하여 요청을 수행할 수 없다.");
            if (client.status == "501")
                console.log(client.status + " : 501(구현되지 않음): 서버에 요청을 수행할 수 있는 기능이 없다. 예를 들어 서버가 요청 메소드를 인식하지 못할 때 이 코드를 표시한다.");
            if (client.status == "502")
                console.log(client.status + " : 502(불량 게이트웨이): 서버가 게이트웨이나 프록시 역할을 하고 있거나 또는 업스트림 서버에서 잘못된 응답을 받았다.");
            if (client.status == "503")
                console.log(client.status + " : 503(서비스를 사용할 수 없음): 서버가 오버로드되었거나 유지관리를 위해 다운되었기 때문에 현재 서버를 사용할 수 없다. 이는 대개 일시적인 상태이다.");
            if (client.status == "504")
                console.log(client.status + " : 504(게이트웨이 시간초과): 서버가 게이트웨이나 프록시 역할을 하고 있거나 또는 업스트림 서버에서 제때 요청을 받지 못했다.");
            if (client.status == "505")
                console.log(client.status + " : 505(HTTP 버전이 지원되지 않음): 서버가 요청에 사용된 HTTP 프로토콜 버전을 지원하지 않는다.");
            if (client.status == "506")
                console.log(client.status + " : 506(Variant Also Negotiates, RFC 2295)");
            if (client.status == "507")
                console.log(client.status + " : 507(용량 부족, WebDAV; RFC 4918)");
            if (client.status == "508")
                console.log(client.status + " : 508(루프 감지됨, WebDAV; RFC 5842)");
            if (client.status == "509")
                console.log(client.status + " : 509(대역폭 제한 초과, Apache bw/limited extension)");
            if (client.status == "510")
                console.log(client.status + " : 510(확장되지 않음, RFC 2774)");
            if (client.status == "511")
                console.log(client.status + " : 511(네트워크 인증 필요, RFC 6585)");
            if (client.status == "598")
                console.log(client.status + " : 598(네트워크 읽기 시간초과 오류, 알 수 없음)");
            if (client.status == "599")
                console.log(client.status + " : 599(네트워크 연결 시간초과 오류, 알 수 없음)");
 
            var strHtml = "";
            strHtml += "<tr><td><font color=#fffff> 상태코드 :          " + client.status + "</font></td></tr>"
            $('#httpStatusDetail').html(strHtml);
        }
 
        client.open("GET", url, true);
        client.send(null);
    }
</script>
<script type="text/javascript">
//     function f_moveWork(id) {
//         alert(id);
 
//         if (id == "Work") {
//             location.href="https://www.해당시스템URL/folder/index.jsp";
//         }
//     }
    function fncGoAfterErrorPage() {
        history.back(-2);
    }
</script>
<title>00시스템</title>
</head>
<body style="text-align: center;">
 
    <div id="errorImage" style="z-index: 0; width: 100%; height: 310px; position:inherit;">
<!--      style="background-repeat:no-repeat; background-attachment: fixed; background-position: center; padding-top: 150px;" alt="folder Error"  -->
        <img src="/abc/abcError/img_error.jpg" alt="에러 페이지" />
    </div>
    
    <div class="" style="z-index: 10;">
<!--         <a class="twitter" href="#" onclick="f_moveWork('Edu');return false;"> -->
<!--             <a class="moveBack" data-title="이전화면으로 이동 하시겠습니까?" href="http://www.edu.net/hrm/index.do"> -->
<!--             <a href="javascript:fncGoAfterErrorPage();" style="padding-top: 5px; padding-bottom: 5px;"> -->
        <span id="EduLogo" style="padding-right: 50px;">
            <a class="moveBack" href="#" onclick="fncGoAfterErrorPage(); return false;" data-title="이전화면으로 이동 하시겠습니까?" >
                <img src="/abc/abcError/go_history.jpg" style="padding-top: 23px; padding-bottom: 5px;" alt="이전화면으로 이동 하시겠습니까?" />
            </a>
        </span>
        <span id="WorkLogo" style="padding-left: 50px;">
            <!--             <a href="#" onclick="f_moveWork('Work'); return false;"> -->
            <a class="moveWork" href="https://www.해당시스템URL/folder/index.jsp" data-title="00시스템로 이동 하시겠습니까?" >
                <img src="/abc/abcError/workLogo.jpg" style="padding-top: 5px; padding-bottom: 5px;" alt="00시스템로 이동" />
            </a>
        </span>
    </div>
    
    <div class="httpStatusList" style="z-index: 10;width: 100%;text-align: left;">
        <table cellpadding="0" cellspacing="0">
            <tbody id="httpStatusList">
                <tr>
                    <td></td>
                </tr>
        </table>
        <table cellpadding="0" cellspacing="0">
            <tbody id="httpStatusDetail">
                <tr>
                    <td></td>
                </tr>
            </tbody>
        </table>
    </div>
    <script type="text/javascript">
        $('a.moveBack').confirm({
            content : "<br /><br />안내전화번호<br /><br />00시스템 044-123-1234<br /><br />",
        });
        $('a.moveBack').confirm({
            buttons : {
                hey : function() {
                    location.href = this.$target.attr('href');
                }
            }
        });
        
        $('a.moveWork').confirm({
            content : "<br /><br />안내전화번호<br /><br />00시스템 044-123-1234<br /><br />",
        });
        $('a.moveWork').confirm({
            buttons : {
                hey : function() {
                    location.href = this.$target.attr('href');
                }
            }
        });
    </script>
</body>
</html>
 
 
cs

 

728x90
반응형