tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Bremford" <>
Subject RE: how to use jssi with tomcat
Date Mon, 18 Sep 2000 14:37:51 GMT
Well, I gave this a bash and got it most of the way there. However, I fear
that just adding the jar to the classpath and associating .jhtml files with
the servlet doesn't quite work (at least not with 3.2b3 it doesn't).

Here's what I did.

1. Got the ApacheJSSI source from

2. As ApacheJSSI.jar is a 2.0 servlet, so you need to, er, link (sorry - the
correct java buzzword escapes me) against the servlet-2.0.jar that comes
with Apache/Jserv. I had one lying around. You can probably get one from somewhere.

3. Add the following line to httpd.conf:

AddHandler jserv-servlet .jhtml

4. Add the following block to web.xml under your WEB-INF directory (not the
one in tomcat/conf. But then I'm running through apache, so YMMV):


5. Now you need to tweak JSSI a bit to get it running with Tomcat (a 2.2
engine) rather than Jserv (a 2.0 engine).

5a. Modify the file src/java/org/apache/servlet/ssi/,
and in the doGet() method replace the line:

String path = req.getPathTranslated();


String path = getServletContext().getRealPath(req.getRequestURI());

This allows the servlet to find the original JSP. From there, I run out of
steam. Making the JAR, adding it to the tomcat classpath and running it gets
as far as parsing the pages, but when it hits a <servlet> tag it complains
about being unable to load the servlet.

A closer examination shows the call context.getServlet("SnoopServlet") in
ServletTagHandler.runServlet is returning null. I can call the servlet
directly, so it should be OK. But since getServlet() was deprecated in the
2.1 spec I don't know how to fix it to work with Tomcats environment.

Any thoughts?

Cheers... Mike

> -----Original Message-----
> From: Alex Chaffee []
> Sent: 17 September 2000 14:24
> To:
> Subject: Re: how to use jssi with tomcat
> From the jGuru FAQ:
> - the JServ JSSI servlet
> should do the trick.
> That is, you can set up a mapping from .jhtml to the exact same
> servlet (see the JSP mapping in server.xml for inspiration).
> If you get this working, please submit a feedback to the FAQ with your
> config file info.
>  - Alex
> On Fri, Sep 15, 2000 at 11:37:23AM -0700, Shilpa Kulkarni wrote:
> > hello all,
> >
> > i want to use <servlet> tag to include the contents of the
> servlet in my
> > page.
> > with apache server, u can use Apache JSSI to do this along
> with Apache
> > Jserv.
> >
> > with tomcat, how do i use JSSI to include <servlet> tags in my jsp.
> >
> > thanks in advance,
> > shilpa.
> --
> Alex Chaffee             
> jGuru - Java News and FAQs
> Creator of Gamelan       
> Founder of Purple Technology
> Curator of Stinky Art Collective

View raw message