|
hello1.java |
|
1 package sutut1;
2
3 import javax.servlet.*;
4 import javax.servlet.http.*;
5 import java.io.*;
6 import java.util.*;
7
8 import us.oh.state.common.utility.*;
9
10 public class hello1 extends HttpServlet {
11
12 //Initialize global variables
13 public void init(ServletConfig config) throws ServletException {
14 super.init(config);
15 }
16
17 //Process the HTTP Get request
18 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
19 HtmlPage page = new HtmlPage(response);
20 String title = "Tutorial - Hello 1";
21 page.title(title);
22 page.body();
23 page.center(true);
24 page.heading(1, title);
25 page.line();
26 page.out.println(new Date());
27 page.center(false);
28 page.close();
29 }
30
31 //Get Servlet information
32 public String getServletInfo() {
33 return "sutut1.hello1 Information";
34 }
35 }
|
hello1.java |
|