:::³»À尴ü:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

P137

***FequestExample1.html

-<html>
<body>
<h1>Request Example1</h1>
<FORM METHOD=POST ACTION="RequestExample1.jsp">
¼º¸í : <INPUT TYPE="text" NAME="name"><br>
Çйø : <INPUT TYPE="text" NAME="studentNum"><br>
¼ºº° : ³²ÀÚ <INPUT TYPE="radio" NAME="sex" VALUE="man" checked>
¿©ÀÚ <INPUT TYPE="radio" NAME="sex" VALUE="woman"><br>
Àü°ø : <SELECT NAME="major">
<OPTION SELECTED VALUE="±¹¹®Çаú">±¹¹®Çаú</OPTION>
<OPTION VALUE="¿µ¹®Çаú">¿µ¹®Çаú</OPTION>
<OPTION VALUE="¼öÇаú">¼öÇаú</OPTION>
<OPTION VALUE="Á¤Ä¡Çаú">Á¤Ä¡Çаú</OPTION>
<OPTION VALUE="üÀ°Çаú">üÀ°Çаú</OPTION>
</SELECT><br>
<INPUT TYPE="submit" value="º¸³»±â">
</FORM>
</body>
</html>

***FequestExample1.jsp

<h1>Request Example1</h1>
<%@ page contentType="text/html;charset=EUC-KR"%>
<%
request.setCharacterEncoding("euc-kr");
%>
<%
String name = request.getParameter("name");
String studentNum = request.getParameter("studentNum");
String sex = request.getParameter("sex");
String major = request.getParameter("major");

if(sex.equals("man")){
sex = "³²ÀÚ";
}else{
sex = "¿©ÀÚ";
}
%>
<body>
¼º¸í : <%=name%><p>
Çйø : <%=studentNum%><p>
¼ºº° : <%=sex%><p>
Çаú : <%=major%>
</body>

-----------------------------

P139

--------------------------------

P141

***ResponseExample1.jsp

<h1>Response Example1</h1>
<%
response.sendRedirect("ResponseExample1_1.jsp");
%>

***ResponseExample1_1.jsp

<%@ page contentType="text/html;charset=EUC-KR"%>
<%
response.setHeader("Pragma","no-cache");
if(request.getProtocol().equals("HTTP/1.1")){
response.setHeader("Cache-Control","no-cache");
}
%>
<html>
<body>
<h1>Response Example1</h1>
http://localhost:8080/myapp/ch06/ResponseExample1.jsp°¡<p>
http://localhost:8080/myapp/ch06/ResponseExample1_1.jsp·Î º¯°æÀÌ µÇ¾ú½À´Ï´Ù.
</body>
</html>


-------------------------------------------
P143
***OutExample1.jsp
<%@ page contentType="text/html;charset=EUC-KR"
buffer="5kb"
%>
<%
int totalBuffer = out.getBufferSize();
int remainBuffer = out.getRemaining();
int useBuffer = totalBuffer - remainBuffer;
%>
<h1>Out Example1</h1>
<b>ÇöÀç ÆäÀÌÁöÀÇ Buffer »óÅÂ</b><p>
Ãâ·Â BufferÀÇ Àüü Å©±â : <%=totalBuffer%>byte<p>
³²Àº BufferÀÇ Å©±â : <%=remainBuffer%>byte<p>
ÇöÀç BufferÀÇ »ç¿ë·® : <%=useBuffer%>byte<p>

-------------------------------------------


:::JSP ½Ç½ÀÇϱâ:::::::::::::::::::::::::::::::::
---OutExample1.jsp------------------------------
<%@page contentType="text/html;charset=EUC-KR"
buffer="5kb"
%>
<%
int totalBuffer=out.getBufferSize();
int remainBuffer=out.getRemaining();
int useBuffer=totalBuffer-remainBuffer;
%>
<h1>Out Example1</h1>
<b>Çö´ëÆÐÀÌÁöÀÇ buffer»óÅÂ</b><p>
Ãâ·Â BufferÀÇ ÀüÅ×Å©±â:<%=totalBuffer%>byte<p>
³²Àº BufferÀÇ Å©±â:<%=remainBuffer%>byte<p>
ÇöÀç BufferÀÇ »ç¿ë·®:<%=useBuffer%>byte<p>

---ResponseExample1_1.jsp----------------------------------
<h1>ResponseExample1</h1>
<%
response.sendRedirect("ResponseExample1_1.jsp");
%>
---
<%@page contentType="text/html;charset=EUC-KR"%>
<%
response.setHeader("Pragma", "no-cache");
if(request.getProtocol().equals("HTTP/1.1.")){
response.setHeader("Cache-Control", "no-cache");
}
%>
<html>
<body>
<h1>ResponseExample1</h1>
http://localhost:8080/ch06/ResponseExample1.jsp°¡<p>
http://localhost:8080/ch06/ResponseExample1_1.jsp·Î º¯°æµÇ¾î½À´Ï´Ù.<p>
</body>
</html>
------------------------------------------------------


:::MySQL µå¶óÀ̹ö ¼³Á¤¹× ¼¼ÆÃÇϱâ:::::::::::::::::
¿¬°á»çÀÌÆ®- http://www.mysql.com
´Ù¿î·Îµå°æ·Î¼ø¼­
- http://www.mysql.com¸ÞÀÎÈ­¸é ÇÏ´ÜÀ§Ä¡Download
- Application programming Interfaces(APIs)
+Official APIs:
+MySQL Connector/j
+MySQL Connector/J3.0--production release
-¸ÞÀÎÈ­¸é ¾Æ·¡ÂÊ:Source and Binaries (zip)
3.0.16-ga 1.2M Pick a mirror
-űرâ¾ÆÀÌÄÜù¹ø° South Korea [New21 Community] HTTP
Ŭ¸¯ÇÏ°í ÁöÁ¤µÈÆÄÀÏ¿¡ ÀúÀåÇϼ¼¿ä
1)mysql-connector-java-3.0.16-ga.zip¾ÐÃàÀ» Ç®°í
(D:\±³À°\jsp\mysql-connector-java-3.0.16-ga)
2)mysql-connector-java-3.0.16-ga-bin.jarÀ»
º¹»çÇÏ¿© ¾Æ·¡ ÇØ´çÆÄÀÏ¿¡ ºÙÇô³Ö±â¸¦ Çϼ¼¿ä.
3)C:\j2sdk1.4.2_03\jre\lib\ext
4)C:\Program Files\Apache Group\Tomcat 4.1\common\lib


JSP½ºÅ͵ð 2004 11 25

¼Ò½ºÀÚ¼¼È÷º¸±â: http://www.6VJ.com/jsp/jsp1125.txt