FileDocCategorySizeDatePackage
HelloWorldServlet.javaAPI DocExample617Mon Oct 28 20:39:36 GMT 2002com.oreilly.javaxp.tomcat.webapp

HelloWorldServlet.java

package com.oreilly.javaxp.tomcat.webapp;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @author Brian M. Coyner
 * @version $Id $
 */
public class HelloWorldServlet extends HttpServlet {

    protected void doGet(HttpServletRequest req, HttpServletResponse res)
            throws ServletException, IOException {

        PrintWriter writer = res.getWriter();
        writer.print("Hello World");
    }
}