package servlet_tests; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.*; import javax.servlet.http.*; public class ServletTest extends HttpServlet { private ServletContext context; public void init(ServletConfig config) throws ServletException { super.init(config); context = config.getServletContext(); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("[Servlet.doPost]"); response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("Hello World"); } }