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.
Thanks,
-Brian
diff -r1.2 SsiEnvironment.java
69d68
< import java.util.Date;
72a72,73
> import java.util.Date;
> import java.util.Enumeration;
257a259,267
>
> Hashtable initialEnv = (Hashtable)
request.getAttribute("initial.env");
> 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: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>