* JSP
브라우저 ====>(요청) 웹서버[ .jsp -> .java -> .class -> 메모리적재 ] ====>(응답) 브라우저
=========================================================
= JSP/test.jsp ==========================================================
<%@page contentType="text/html" %>
<html>
<body>
Hello World
</body>
</html>
==========================================================
* servlet
웹에서 request/reponse 서비스를 지원해주는 server side에서 돌아가는 모듈
=========================================================
= servlet/test.java =
=========================================================
package com.test
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class test extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.println("Hello World");
out.println("</body>");
out.println("</html>");
out.close();
}
}
==========================================================