/* * @(#)FingerServlet.java 1.6 96/11/03 David Connelly * * Copyright (c) 1996 Sun Microsystems, Inc. All Rights Reserved. * * Permission to use, copy, modify, and distribute this software * and its documentation for NON-COMMERCIAL purposes and without * fee is hereby granted provided that this copyright notice * appears in all copies. Please refer to the file "copyright.html" * for further important copyright and licensing information. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. */ import java.servlet.*; import java.io.*; import java.net.*; import java.util.*; import java.servlet.*; /** * Finger servlet. This servlet uses the finger protocol to query * information about users on specified hosts. The query string * parameters user, hosts, and verbose * can be used to specify the user and hosts to query. The parameter * user is the user name, hosts is a comma-separated * list of host names to query, and verbose if specified will * cause verbose output to be generated. For example, *
 *     http:/goa/finger.html?user=dac&hosts=eno,doppio&verbose=yes
 * 
* This URL will request full information about user 'dac' on both * hosts 'eno' and 'doppio'. * * @version 1.6, 11/03/96 * @author David Connelly */ public class myfingerServlet extends GenericServlet { /* * Port number for finger daemon. */ static final int FINGER_PORT = 79; /** * Handles a single finger request from the client. */ public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { String user = req.getParameter("user"); String hosts = req.getParameter("hosts"); String verbose = req.getParameter("verbose"); res.setContentType("text/html"); PrintStream out = new PrintStream(res.getOutputStream()); out.println(""); out.println("Finger Servlet"); out.println(""); out.println("

Finger results:

"); out.println("
");
     out.println(" HELLO THIS IS A TEST");
    new startMainServer("128.230.7.14",9010,out);
    }
}