ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

package test;

//servlet 1 import 3๊ฐœ
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

//servlet 2 ๋ฐ˜๋“œ์‹œ public ํด๋ž˜์Šค๋กœ ์ž‘์„ฑ
public class HelloWorld

//servlet 3 HttpServlet์„ ์ƒ์†๋ฐ›๊ธฐ
extends HttpServlet {
 
 //servlet 4 ์ „์†ก๋ฐฉ์‹์— ๋”ฐ๋ผ doXXX() ๋ฉ”์†Œ๋“œ์ž‘์„ฑ
 // get ๋ฐฉ์‹ -> doGet()
 // post๋ฐฉ์‹ -> doPost()
 // ์ „์†ก๋ฐฉ์‹๊ณผ ์ƒ๊ด€์—†๋‹ค๋ฉด -> service()

 //์•„๋ž˜์˜ doGet ๋ฉ”์†Œ๋“œ๋Š” ๋ฉ”์†Œ๋“œ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ์ด ์•„๋‹Œ ์˜ค๋ฒ„๋ผ์ด๋”ฉ ใ…Žใ…Ž
 public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {

  //servlet 5 ์ถœ๋ ฅ์ŠคํŠธ๋ฆผ, ์ถœ๋ ฅ๋ฌธ์„œํƒ€์ž… ์ง€์ •
  response.setContentType("text/html;charset = euc-kr");
  PrintWriter out = response.getWriter();

  //servlet 6 ๋น„์ง€๋‹ˆ์Šค ๋กœ์ง ์ฒ˜๋ฆฌ
 }
}

'PROGRAMMING' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

jsp ์—๋ŸฌํŽ˜์ด์ง€ ์ง€์ •  (0) 2010.06.22
sqlinform.com/online.phtml  (0) 2010.06.16
์ด๊ฒƒ์ด ์Šค์œ™์ธ๊ฑฐ์•ผ?  (0) 2010.05.29
๋กœ๋˜์ƒ์„ฑ๊ธฐ ใ…Žใ…Ž  (0) 2010.05.15
Model1 ๋ฐฉ์‹  (0) 2010.05.14
๋Œ“๊ธ€