W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 1997

Re: any servlet example ?

From: Benoit Mahe <Benoit.Mahe@sophia.inria.fr>
Date: Mon, 08 Sep 1997 10:51:57 +0200
Message-Id: <199709080851.KAA23849@www43.inria.fr>
To: Philippe Le Foll <phillf@iu-vannes.fr>
cc: www-jigsaw@w3.org (Mailling List), bmahe@www43.inria.fr
> I am planing to use jigsaw with my students and I am
> looking for some examples:
> 
>   - Data base interface (I plane using Postgres95)

 The ssi command <!--#jdbc ... --> allows you to interface a database,
 see http://www.w3.org/Jigsaw/Tutorials/SSIResource.html for an example.

 If you want to write a resource wich use JDBC, see 
 w3c.jigsaw.pics.DataBase ( a very simple interface).

>   - Servlet
 
 This is the HelloWorld Servlet :

 * @(#)HelloWorldServlet.java   1.9 97/05/22
 * 
 * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of Sun
 * Microsystems, Inc. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Sun.
 * 
 * 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.
 * 
 * CopyrightVersion 1.0
 */

import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;

/**
 * Hello World. This servlet simply says hi. 
 *
 * This is useful for testing our servlet admin tool, since
 * this servlet isn't started up by default when Jeeves starts up.
 * Load it by going to http://<server>/admin/servlet.html
 * and giving it the name "hello" and the class "HelloWorldServlet".
 * Then, invoke by using the URL http://<server>/servlet/hello
 */

public class HelloWorldServlet extends HttpServlet {

    public void doGet (HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException
    {
        res.setContentType("text/html");

        ServletOutputStream out = res.getOutputStream();
        out.println("<html>");
        out.println("<head><title>Hello World, version 2.0</title></head>");
        out.println("<body>");
        out.println("<h1>Hello World !!!</h1>");
        out.println("</body></html>");
    }

    public String getServletInfo() {
        return "Create a page that says <i>Hello World</i> and send it back";
    }
}

*****

The servlet documentation :
 http://jserv.javasoft.com/products/java-server/webserver/fcs/doc/index_develop
er.html

****

>   - RMI

 You can look the source code of jigadmin (wich use RMI)

 w3c.jigsaw.admin.*
 w3c.jigadm.*

> 
> Any thing will be nice even if not fully operationnal
> I just need example not beeing to big.
>  
> -- 
> La vitesse peut tuer: Utilisez Windows    (o^o)
> ======================================oOO==(~)==OOo========
> phillf@fridu.com, Philippe Le Foll Fridu (+33/0)609.794.781
> 

- Benoît Mahé -------------------------------------------------------
World Wide Web Consortium                       bmahe@sophia.inria.fr 
Architecture domain - Jigsaw Team               tel : 04 93 65 79 89
---------------------------------------------------------------------
Received on Monday, 8 September 1997 04:52:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:26 GMT