In this tutorial, we will deploy a “HelloWorld” servlet using Eclipse. The Tomcat server is integrated in and launched by Eclipse.
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub response.setContentType("text/html"); PrintWriter pw = response.getWriter(); pw.println(""); pw.println(""); pw.println(""); pw.println("<h1>Hello World</h1>"); pw.println(""); }