톰캣 같은 was 서버를 직접 설치하고, 그 위에 서블릿 코드를 클래스 파일로 빌드해서 올린 다음, 톰캣 서버 실행
HttpServlet 추가
// https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api
compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.1'
javax.servlet.Servlet
public interface Servlet {
// servlet is constructed, then initialized with the init method
void init(javax.servlet.ServletConfig servletConfig) throws javax.servlet.ServletException;
// which the servlet can use to get any information
javax.servlet.ServletConfig getServletConfig();
// Any calls from clients to the service method are handled.
void service(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse) throws javax.servlet.ServletException, java.io.IOException;
// which allows the servlet to return basic information
// about itself, such as author, version, and copyright.
java.lang.String getServletInfo();
// The servlet is taken out of service, then destroyed with the destroy method, then garbage collected and finalized.
void destroy();
}