MCPcopy Create free account
hub / github.com/castello/spring_basic / HelloServlet

Class HelloServlet

ch2/HelloServlet.java:14–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13//@WebServlet(urlPatterns={"/hello"}, loadOnStartup=1)
14 @WebServlet("/hello")
15 public class HelloServlet extends HttpServlet {
16 @Override
17 public void init() throws ServletException {
18 // 서블릿 초기화 - 서블릿이 생성 또는 리로딩 때, 단 한번만 수행됨.
19 System.out.println("[HelloSerlvet] init()");
20 }
21
22 @Override // 호출될 때마다 반복적으로 수행됨.
23 public void service(HttpServletRequest request, HttpServletResponse response) {
24 // 1. 입력
25 // 2. 처리
26 // 3. 출력
27 System.out.println("[HelloSerlvet] service()");
28 }
29
30 @Override
31 public void destroy() {
32 // 뒷정리 작업 - 서블릿이 제거(unload)될 때, 단 한번만 수행됨.
33 System.out.println("[HelloSerlvet] destroy()");
34 }
35 }
36
37
38

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected