KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > servlets > LZNullServlet


1 /* *****************************************************************************
2  * LZNullServlet.java
3  * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package org.openlaszlo.servlets;
11
12 import java.io.*;
13 import java.net.*;
14 import java.util.*;
15 import javax.servlet.*;
16 import javax.servlet.http.*;
17
18 /**
19  * LZNullServlet is a simple servlet for testing Tomcat performance.
20  */

21 public class LZNullServlet extends HttpServlet {
22
23     public void init (ServletConfig config) throws ServletException
24     {
25         super.init (config);
26
27         log("Initializing LZNullServlet!");
28
29     }
30
31     public void doGet(HttpServletRequest req, HttpServletResponse res)
32         throws IOException
33     {
34         res.setContentType ("text/html");
35         ServletOutputStream out = res.getOutputStream();
36
37         out.println ("<html><head><title>X</title></head><body></body></html>");
38         out.close();
39     }
40
41     public void doPost(HttpServletRequest req, HttpServletResponse res)
42         throws IOException
43     {
44         doGet(req, res);
45     }
46 }
47
48
Popular Tags