"); out.println(""); out.println(" HelloServlet "); out.println(""); out.println(""); out.println("

Hello Servlet



"); out.println("

안녕하세요 서블릿 ^^



"); out.println(""); out.println(""); } }"> "); out.println(""); out.println(" HelloServlet "); out.println(""); out.println(""); out.println("

Hello Servlet



"); out.println("

안녕하세요 서블릿 ^^



"); out.println(""); out.println(""); } }"> "); out.println(""); out.println(" HelloServlet "); out.println(""); out.println(""); out.println("

Hello Servlet



"); out.println("

안녕하세요 서블릿 ^^



"); out.println(""); out.println(""); } }">
package ex02;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HelloServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		// 이 후의 문자열 html로 인식하라고 지정.
		response.setContentType("text/html; charset=UTF-8");
		
		PrintWriter out = response.getWriter();
		out.println("<html>");
		out.println("<head>");
		out.println("<title> HelloServlet </title>");
		out.println("</head>");
		out.println("<body>");
		out.println("<h1>Hello Servlet</h1><br><br/>");
		out.println("<h2>안녕하세요 서블릿 ^^</h2><br><br/>");
		out.println("</body>");
		out.println("</html>");
	}
}