/** 
 * This program is an example from the book "Internet 
 * programming with Java" by Svetlin Nakov. It is freeware. 
 * For more information: http://www.nakov.com/books/inetjava/ 
 */ 
import java.io.*; 
import javax.servlet.*; 
import javax.servlet.http.*; 
 
public class FirstServlet extends HttpServlet { 
    public void doGet(HttpServletRequest aRequest, 
        HttpServletResponse aResponse) 
    throws ServletException, IOException { 
        PrintWriter out = aResponse.getWriter(); 
        out.println("<HTML>"); 
        out.println("The time is: " + new java.util.Date()); 
        out.println("</HTML>"); 
    } 
}
Back to Internet Programming with Java books's web site