tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Zhou" <>
Subject [SSI] initial environment?
Date Mon, 03 Dec 2001 17:36:34 GMT
Hi tomcat-developers,

Is there a prefered way to set the initial env for an SSI page? I'm working
on a simple template servlet using SSI to allow something like:

<!--#include virtual="${header}"-->
<!--#include virtual="${body}"-->
<!--#include virtual="${footer}"-->

Most of the support are there, but how does one set the initial env
programatically from a servlet? I know probably I can add a
"tomcat.ssi.environment" SsiEnvironment instance as attribute of the
HttpServletRequest, but it seems to involve the whole catalina.jar and
servlets-ssi.jar (and maybe more) being copied into
servletContext/WEB-INF/lib. Is it possible we leave a light-weight,
loosly-coupled hook for this purpose? I give an example below just using
Hashtable, of course we can change the attribute name.

JSP and taglib can achieve the same thing, but I just like the
non-invasiveness of SSI better - everything still in valid HTML.



diff -r1.2
< import java.util.Date;
> import java.util.Date;
> import java.util.Enumeration;
>         Hashtable initialEnv = (Hashtable)
>         if (initialEnv != null) {
>             Enumeration e = initialEnv.keys();
>             while (e.hasMoreElements()) {
>                 String key = (String) e.nextElement();
>                 this.setVariable(key, (String) initialEnv.get(key));
>             }
>         }

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message