// define strings for the type of the document String docType = ""; String html = "\n"; // get the output stream to send response back to the client PrintWriter output = response.getWriter(); // set the response type to be HTML response.setContentType("text/html"); // write the response document to the user output.println(docType); output.println(html); output.println(""); output.println("A Response From a Servlet"); output.println(""); output.println("

Welcome to Servlets!

"); output.println("

How cool is that?

"); output.println(""); output.println("\n"); // close the connection to the client output.close();