View Javadoc

1   package net.trajano.webutil;
2   
3   import java.io.IOException;
4   import java.util.Date;
5   
6   import javax.servlet.http.HttpServlet;
7   import javax.servlet.http.HttpServletRequest;
8   import javax.servlet.http.HttpServletResponse;
9   
10  /***
11   * This is a sample servlet, typically you would not use this, but it is useful
12   * for testing the sanity of your web application configuration.
13   * 
14   * @web.servlet name="HelloWorld"
15   * @web.servlet-mapping url-pattern="/HelloWorld"
16   * @author <a href="trajano@yahoo.com">Archimedes Trajano </a>
17   * @version $Id: HelloWorldServlet.java,v 1.1 2005/03/04 22:13:29 trajano Exp $
18   */
19  public class HelloWorldServlet extends HttpServlet {
20      /***
21       * This prints out the standard "Hello world" message with a date stamp.
22       * 
23       * @param request
24       *                   the HTTP request object
25       * @param response
26       *                   the HTTP response object
27       * @throws IOException
28       *                    thrown when there is a problem getting the writer
29       */
30      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
31          response.getWriter().println("Hello world on " + new Date());
32      }
33  }