RunTurtle

[ JSP ] What is Servlet?? 본문

다양한 공부/JSP

[ JSP ] What is Servlet??

RunTurtle 2024. 2. 27. 14:45

https://mangkyu.tistory.com/14

 

[JSP] 서블릿(Servlet)이란?

1. Servlet(서블릿) 서블릿을 한 줄로 정의하자면 아래와 같습니다. 클라이언트의 요청을 처리하고, 그 결과를 반환하는 Servlet 클래스의 구현 규칙을 지킨 자바 웹 프로그래밍 기술 간단히 말해서,

mangkyu.tistory.com


자바를 사용하여 웹을 만들기 위해 필요한 기술이다!
오라클 공식문서에서 한번 보자

Defines methods that all servlets must implement.
A servlet is a small Java program that runs within a Web server. Servlets receive and respond to requests from Web clients, usually across HTTP, the HyperText Transfer Protocol.
To implement this interface, you can write a generic servlet that extends javax.servlet.GenericServlet or an HTTP servlet that extends javax.servlet.http.HttpServlet.
This interface defines methods to initialize a servlet, to service requests, and to remove a servlet from the server.

These are known as life-cycle methods and are called in the following sequence:

1. The servlet is constructed, then initialized with the init method.
2. Any calls from clients to the service method are handled.
3. The servlet is taken out of service, then destroyed with the destroy method, then garbage collected and finalized.

In addition to the life-cycle methods, this interface provides the getServletConfig method, which the servlet can use to get any startup information, and the getServletInfo method, which allows the servlet to return basic information about itself, such as author, version, and copyright.

 

모든 서블릿이 반드시 구현해야 하는 메서드들을 정의한다.

 

서블릿은 웹 서버내에서 실행되는 작은 자바 프로그램이다.  일반적으로 HTTP를 통해 웹 클라이언트의 요청을 받고 응답한다!

'다양한 공부 > JSP' 카테고리의 다른 글

<c:if> 태그란 무엇인가?  (0) 2023.12.31