4576l2 Listing 2: HelloWorld.java, a simple applet that handles the GET request method import java.io.*; import java.text.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Set the MIME content type for the response response.setContentType("text/html"); // Get the output stream to STDOUT PrintWriter out = response.getWriter(); // Print some HTML out.println(""); out.println("Hello, world"); out.println(""); out.println("

Hello, world

"); // Get the user's first name, if he or she passed it to us String firstname = request.getParameter("firstname"); // Print a special greeting for people who give us their name if (firstname != null) { out.println("

Your first name is \"" + firstname + "\"

"); } // Finish the HTML out.println(""); } }