PrintWriter out = response.getWriter(); response.setContentType("text/html"); out.println("<h1>Hello from a Servlet</h1>"); out.println("<p>Server time is now "); out.println(new Date().toString());