On Thu, 22 Mar 2001, James Strachan wrote:

> I was about to start experimentation on the current Tomcat 4.x distribution
> of Jasper and just wanted to ping this list first to see if anyone had tried
> this kind of thing before (or were in the middle of doing it themselves).
> 
> 
> I'm interested in having a configurable (on a per web-app bases for now) SAX
> XMLFilter object used to preprocess the XML format of JSP before the Java
> code gets generated.
> 
> This mechanism would enable compile time transformation of JSP, for example
> to implement "compile time tags" using XSLT in a similar way to Cocoon's
> XSP.
> 
> >From my first looks at the source code it would appear a patch to
> 
>     org.apache.jasper.compiler.ParseXJspSax
> 
> would do the trick (in the parse() method).
> 

I presume that you are only interested in JSP pages that use the XML
syntax, right?  If so, this is probably the right place -- you'd want to
fuss with how Jasper identifies its input source.

> 
> Does anyone have any warnings or info before I dive in?
> 

One other consideration is how Jasper checks to see if a page has been
updated.  Normally it checks the "last modified timestamp" of the xxx.jsp
file.  You will need to deal with that issue as well, because you don't
want to regenerate and recompile the page every single time.

Given that, a completely different strategy to consider is to mess with
how Catalina (the servlet container part of Tomcat 4.0) returns "static"
resources from the web application.  I have to warn you, though, that this
is pretty intense going -- we use a JNDI context to hide where the real
files are (unpacked on disk, directly in the WAR, or somewhere else).

> <James/>
> 
> 
> James Strachan

Craig McClanahan

Reply via email to