Re: Server-Side-Include Servlets

Brian Dupras wrote:

> I've been tring to get SSI Servlets to work with no progress.  Can someone
> help me out.
>
> I've got two servlets - one that inherits from HttpServlet and one that
> inherits from GenericServlet.  I've responded to doGet() and service().
> Neither works.  They're installed int he standard www/servlets directory.
>
> I've tried placing all sorts of code in the .shtml file:
>
> <HTML>
> <HEAD>
> <TITLE>Try Server Side Include</TITLE>
> </HEAD>
> <BODY>
> Trying Server Side Include SimpleHelloServlet:<BR><BR>
>
> <!--#servlet name="SimpleHelloServlet"-->

>
> <!--#servlet name="SimpleHelloServlet" code="/servlets/SimpleHelloServlet"-->

This is the good syntax.

>
> <!--#servlet name="SimpleHelloServlet" code="servlets.SimpleHelloServlet"-->
> <!--#servlet name="SimpleHelloServlet" code="SimpleHelloServlet"-->
>
> Trying Servlet tag
> <servlet name="SimpleHelloServlet"
> code="/servlets/SimpleHelloServlet></servlet>
> <servlet name="servlets.HelloWorldSSI"></servlet>
> <servlet name="/servlets/HelloWorldSSI"></servlet>
> <servlet name="servlets/HelloWorldSSI"></servlet>

The servlet tag doesn't works with Jigsaw.

>
>
> </BODY>
> </HTML>
>
> Some of these do nothing, some of them give me an error and a half on an
> HTML page.  Ergh...  SimpleHelloServlet simply needs to output a HTML
> fragment.
>
> For a SSI servlet that needs to output an HTML fragment, do I inherit from
> HttpServlet or GenericServlet?

HttpServlet is better because it simplifies writing HTTP servlets, but you can
use
GenericServlet if you want.

>
>
> Do I impliement service(), doGet(), or otherwise?

If your servlet simply needs to output HTML, just implements the doGet method.

>
> Thanks,
> Brian

--
- Benoît Mahé -------------------------------------------------------
                      World Wide Web Consortium (W3C)
                    Architecture domain - Jigsaw Team

  http://www.w3.org/People/Mahe - bmahe@w3.org - +33.4.92.38.79.89
---------------------------------------------------------------------

Received on Monday, 22 February 1999 04:41:39 UTC