1.JSP 로 헬로 월드를 나오게 하시오.
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
Hello World!
</body>
</html>
2. 아래를 프로그래밍 하시오.
-JSP 프로젝트 생성
-/hello 로 치고 들어오면 Hello 를 출력하는 HelloWorld.java 서블릿 파일 작성 후
출력: 안녕하세요.
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/Hello")
public class HelloWorld extends HttpServlet {
private static final long serialVersionUID = 1L;
public HelloWorld() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.getWriter().append("Hello");
System.out.println("안녕하세요.");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
3. 프로토콜이란 무엇이며, 프로토콜의 종류는?
- Protocol is sign to connect to others.
- FTP: File Transfer Protocol
- SMTP: Simple Mail Transfer Protocol
- POP: Post Office Protocol
- DHCP: Dynamic Host Configuration Protocol
4. 아래를 프로그래밍 하시오.
아래의 주소를 접속시 아래가 웹브라우져에 나타나도록 하시오.
//
http://localhost:8282/프로젝트명/programmer.jsp
I am a programmer (웹브라우져 출력)
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
I am a programmer
</body>
</html>
5. 아래를 설명하시오.
-DNS
-SMTP, HTTP, DHCP
-포트번호
-IP 주소
- DNS(Domain Name System): Replacing the IP.
- SMTP(Simple Mail Transfer Protocol): Email server system.
- HTTP(HyperText Transfer Protocol): Server responses from the requests of the clients.
- DHCP(Dynamic Host Configuration Protocol): Automatically assigning IP.
- port number: socket number
- IP(Internet Protocol) address: Assigned number for network.