import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.ResourceBundle; public abstract class HttpServlet { private static final String LSTRING_FILE = "javax.servlet.http.LocalStrings"; private static final ResourceBundle lStrings = ResourceBundle.getBundle(LSTRING_FILE); // 후크 메소드 (FrameworkServlet가 오버라이드 함) protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String msg = lStrings.getString("http.method_get_not_supported"); sendMethodNotAllowed(req, resp, msg); } // 후크 메소드 (FrameworkServlet가 오버라이드 함) protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // 위와 같음 } // 다른 후크 메소드 // doHead() // doDelete() // doPut() private void sendMethodNotAllowed(HttpServletRequest req, HttpServletResponse resp, String msg) throws IOException { // 에러를 응답한다. } }