(adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-8242763509535969", enable_page_level_ads: true }); 'code/JSP' 카테고리의 글 목록 (2 Page) :: 깜냥깜냥


Application.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
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%
    request.setCharacterEncoding("euc-kr");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Application.jsp</title>
</head>
<body>
    <center>
        <h2>영역과 속성 테스트</h2>
        <form name="f1" method="post" action="Session.jsp">
            <table border="1" cellpadding="10" cellspacing="0">
                <tr>
                    <td colspan="2" align="center">Application 영역에 저장할 내용들</td>
                </tr>
                <tr>
                    <td>이름</td>
                    <td><input type="text" name="username" style="border: 0px;"
                        size="20"></td>
                </tr>
                <tr>
                    <td>아이디</td>
                    <td><input type="text" name="id" style="border: 0px;"
                        size="20"></td>
                </tr>
                <tr>
                    <td>패스워드</td>
                    <td><input type="text" name="pass" style="border: 0px;"
                        size="20"></td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><input type="submit" value="전송"></td>
                </tr>
            </table>
        </form>
    </center>
</body>
</html>

Session.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
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%
    request.setCharacterEncoding("euc-kr");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Session.jsp</title>
</head>
<body>
    <center>
        <h2>영역과 속성 테스트</h2>
        <%    String username=request.getParameter("username");
            String id=request.getParameter("id");
            String pass = request.getParameter("pass");
            application.setAttribute("username", username);
            application.setAttribute("id", id);
            
        %>
        <h3>${username}님
            반갑습니다.<br> ${username}님의 아이디는 ${id}입니다.
        </h3>
 
        <form name="f2" method="post" action="Save.jsp?pass=<%=pass%>">
            <table border="1" cellpadding="10" cellspacing="0">
                <tr>
                    <td colspan="2" align="center">Session 영역에 저장할 내용들</td>
                </tr>
                <tr>
                    <td>e-mail 주소</td>
                    <td><input type="text" name="email" style="border: 0px;"
                        size="30"></td>
                </tr>
                <tr>
                    <td>집주소</td>
                    <td><input type="text" name="address" style="border: 0px;"
                        size="40"></td>
                </tr>
                <tr>
                    <td>전화번호</td>
                    <td><input type="text" name="tel" style="border: 0px;"
                        size="20"></td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><input type="submit" value="전송"></td>
                </tr>
            </table>
        </form>
</body>
</html>

Save.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
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%
    request.setCharacterEncoding("euc-kr");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Save.jsp</title>
</head>
<body>
    <center>
        <h2>영역과 속성 테스트</h2>
        <%
            String email = request.getParameter("email");
            String address = request.getParameter("address");
            String tel = request.getParameter("tel");
            String pass = request.getParameter("pass");
            application.setAttribute("username", application.getAttribute("username"));
        %>
        <%
            application.setAttribute("email", email);
            application.setAttribute("address", address);
            application.setAttribute("tel", tel);
        %>
        ${username}님의 정보가 모두 저장되었습니다.<br> <br> <a
            href="Check.jsp?pass=<%=pass%>">확인하러 가기</a>
    </center>
</body>
</html>

check.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
61
62
63
64
65
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%
    request.setCharacterEncoding("euc-kr");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Check.jsp</title>
</head>
<body>
    <center>
        <h2>영역과 속성 테스트</h2>
        <br> <br>
        <%
            application.setAttribute("username", application.getAttribute("username"));
            application.setAttribute("id", application.getAttribute("id"));
            session.setAttribute("email", session.getAttribute("email"));
            session.setAttribute("address", session.getAttribute("address"));
            session.setAttribute("tel", session.getAttribute("tel"));
            String pass = request.getParameter("pass");
        %>
        <form>
            <table border="1" cellpadding="10" cellspacing="0">
                <tr>
                    <td colspan="2" align="center">Application 영역에 저장할 내용들</td>
                </tr>
                <tr>
                    <td>이름</td>
                    <td>${username}</td>
                </tr>
                <tr>
                    <td>아이디</td>
                    <td>${id}</td>
                </tr>
                <tr>
                    <td>패스워드</td>
                    <td><%=pass %></td>
                </tr>
            </table>
        </form>
        <br> <br>
        <form>
            <table border="1" cellpadding="10" cellspacing="0">
                <tr>
                    <td colspan="2" align="center">Session 영역에 저장할 내용들</td>
                </tr>
                <tr>
                    <td>e-mail 주소</td>
                    <td>${email}</td>
                </tr>
                <tr>
                    <td>집주소</td>
                    <td>${address}</td>
                </tr>
                <tr>
                    <td>전화번호</td>
                    <td>${tel}</td>
                </tr>
            </table>
        </form>
    </center>
</body>
</html>


request는 get 방식에서 가져오기 힘듭니다! 그래서 action이나 경로에서 표시를 해줘야합니다.


 



Top.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%
    request.setCharacterEncoding("euc-kr");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>top.jsp</title>
</head>
<body>
    Login | Join
</body>
</html>
 

left.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%
    request.setCharacterEncoding("euc-kr");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>left.jsp</title>
</head>
<body>
    <center>
        <a href="./template.jsp?page=newitem">신상품</a> <br>
        <a href="./template.jsp?page=bestitem">인기상품</a>
    </center>
</body>
</html>

newitem.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%
    request.setCharacterEncoding("euc-kr");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>newitem.jsp</title>
</head>
<body>
    <center>
        <h2>신상품 목록입니다.</h2>
    </center>
</body>
</html>

bestitem.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>bestitem.jsp</title>
</head>
<body>
    <center>
        <h2>인기상품 목록입니다.</h2>
    </center>
</body>
</html>

bottom.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%
    request.setCharacterEncoding("euc-kr");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>bottom.jsp</title>
</head>
<body>
 
    <center>Since 2017</center>
 
</body>
</html>

template.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
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%
    request.setCharacterEncoding("euc-kr");
%>
<%--여기가 첫 화면 입니다~~~ --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>template.jsp</title>
</head>
<body>
    <%
        String pagefile = request.getParameter("page");
        if (pagefile == null) {
            pagefile = "newitem";
        }
    %>
    <form name="f1" method="get">
        <table border="1" cellpadding="15" cellspacing="0" width="800"
            height="300">
            <tr>
                <td colspan="2"><jsp:include page="top.jsp"></jsp:include></td>
            </tr>
            <tr>
                <td><jsp:include page="left.jsp"></jsp:include></td>
                <td width="650"><jsp:include page='<%=pagefile + ".jsp"%>'></jsp:include></td>
            </tr>
            <tr>
                <td colspan="2"><jsp:include page="bottom.jsp"></jsp:include></td>
            </tr>
        </table>
    </form>
</body>
</html>


include 액션 태그를 이용하여 페이지를 합쳐줍니다.


template에서 실행한 첫 화면입니다.

인기 상품을 눌렸을 때의 화면입니다. 인기 상품을 눌리면 주소값에 '?page=bestitem'이 추가 되신 걸 볼 수 있습니다.


이 화면은 신상품을 눌렸을 때의 화면입니다. 인기 상품을 눌리면 주소값에 '?page=newitem'이 추가 되신 걸 볼 수 있습니다.


여기서 가장 중요한 건  left.jsp와 template.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
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>request test</title>
<script language="javascript">
    document.cookie = "test=OK.";
</script>
 
</head>
<body>
    <h2 align="center">request 테스트 폼</h2>
    <hr>
    <form name="f1" action=01_1.jsp method=post>
        <table border="1" cellpadding="10" cellspacing="0" align="center">
            <tr>
                <td>이름</td>
                <td><input type="text" name=name width="15" size="10"></td>
            </tr>
            <tr>
                <td>직업</td>
                <td><select name="job"><option selected>학생</option>
                        <option>회사원</option>
                        <option>주부</option></select></td>
            </tr>
            <tr>
                <td>관심분야</td>
                <td><input type="checkbox" name="inter" value="정치">정치 <input
                    type="checkbox" name="inter" value="사회">사회 <input
                    type="checkbox" name="inter" value="정보통신">정보통신</td>
            </tr>
            <tr>
                <td colspan="2" align="center"><input type="submit" value="확인"
                    name="B1"> <input type="reset" value="취소" name="B2">
            </tr>
        </table>
    </form>
</body>
</html>








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
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%
    request.setCharacterEncoding("euc-kr");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title></title>
</head>
<body>
    <h2 align="center">request 테스트 결과 - 1</h2>
    <hr>
    <table border=1 cellpadding="10" cellspacing="0" align="center">
        <tr>
            <td>이름</td>
            <td><%=request.getParameter("name")%></td>
        </tr>
        <tr>
            <td>직업</td>
            <td><%=request.getParameter("job")%></td>
        </tr>
        <tr>
            <td>관심분야</td>
            <td>
                <%
                    String a1[] = request.getParameterValues("inter");
                    for (int i = 0; i < a1.length; i++) {
                        out.println(a1[i] + "<br>");
                    }
                %>
            </td>
        </tr>
    </table>
    <hr>
    <center>
        <h2>request 테스트 결과 -2</h2>
        <table>
            <tr>
                <td>1.클라이언트 IP 주소: <%=request.getRemoteAddr()%><br>
                2.요청메서드: <%=request.getMethod()%><br>
                <%Cookie cookie[] = request.getCookies();%>
                3.<%=cookie[0].getName()%>에 설정된 쿠기값: <%=cookie[0].getValue()%><br>
                4.프로토콜:<%=request.getProtocol()%></td>
            </tr>
        </table>
    </center>
</body>
</html>




get 방식에서 한글이 깨진다면 
C:\Program Files\Apache Software Foundation\Tomcat 8.0\conf의 server.xml 파일 중

1
2
3
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
에서 

1
2
3
<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" URIEncoding="UTF-8" />
즉, URIEncoding="UTF-8" 이나 URIEncoding="EUC-KR"을 추가해주시면 됩니다.


weberror1.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
    <%@page isErrorPage="true" %>
    <%response.setStatus(200); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Error</title>
</head>
<body>
<h2>!!!!!!!Error!!!!!!!</h2>
</body>
</html>




web.xml
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
<?xml version="1.0" encoding="UTF-8"?>
    id="WebApp_ID" version="3.1">
    <display-name>WebError</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
 
    <error-page>
        <error-code>400</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>401</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>402</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>403</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>404</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>405</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>406</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>407</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>408</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>409</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>410</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>411</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>412</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>413</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>414</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>415</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>416</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>417</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>418</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>420</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>422</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>423</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>424</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>425</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>426</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>428</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>429</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>431</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>444</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>449</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>450</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>451</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>494</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>495</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>496</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>497</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>499</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>501</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>502</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>503</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>504</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>505</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>506</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>507</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>508</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>509</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>510</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>511</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>598</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
    <error-page>
        <error-code>599</error-code>
        <location>/weberror1.jsp</location>
    </error-page>
</web-app>


편의상 같은 jsp로 했지만  각각의 location 부분에  다른 파일을 넣어도 됩니다. 

test.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Test</title>
</head>
<body>
<%
int num=1004849932/0;
%>
</body>
</html>

 0을 나눈다는 개념은 틀린 것이니 당연히 에러가 나겠죠? 


이처럼 에러 코드 대신 내가 만들어 준 파일이 뜹니다.

+ Recent posts