KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > echowebserver > EchoWebServer


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) 2003-2005 QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package echowebserver;
16
17 import java.io.*;
18 import java.util.StringTokenizer JavaDoc;
19 import org.quickserver.net.*;
20 import org.quickserver.net.server.*;
21
22 import java.util.logging.*;
23 import org.quickserver.util.logging.*;
24
25 /**
26  * A simple HTTP server that generates a Web page
27  * showing all the data that it received from
28  * the Web client.
29  * @author Akshathkumar Shetty
30  */

31 public class EchoWebServer {
32     public static void main(String JavaDoc args[]) {
33         QuickServer myServer = new QuickServer();
34         String JavaDoc confFile = "conf"+
35             File.separator+"EchoWebServer.xml";
36         Object JavaDoc config[] = new Object JavaDoc[] {confFile};
37         if(myServer.initService(config)==true) {
38             try {
39                 myServer.startServer();
40                 myServer.startQSAdminServer();
41             } catch(AppException e){
42                 System.err.println("Error in server : "+e);
43                 e.printStackTrace();
44             }
45         }
46     }
47 }
48
Popular Tags