tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Nielsen <>
Subject [PROPOSAL] jasper2 detection of compile time page include changes
Date Wed, 24 Apr 2002 15:52:51 GMT
A common problem Tomcat users have is that Jasper does not detect when
a compile time included file <%@include file="..."%> changes so that
it can recompile dependent JSP pages.  This propsoal maps out a possible
solution for this.

Create a new class (JspDependency) which is used to store mapping of JSP 
pages to dependent compile time included files.  This class will be 
created for each web application context and the data it depends upon
serialized to a special file in the work directory on context stop,
and read from that file on context startup.  Proposed filename is

Here is how this integrates into Jasper:

On context start instantiate a JspDependency object and read in the
dependencies from JSP_DEPENDENCY.ser.  If there are dependencies,
start a background thread which checks for changes in compile time
included files once each 5-15 minutes. Perhaps make this configurable.
If changes are detected, set flags for dependent JSP pages which are 
affected.  Using a thread to accomplish this rather than having JSP 
Load do the dependency checks should reduce the request latency 
overhead for detecting these changes.

The JSP Load method will call a method in JspDependency to determine
whether the current page needs to be recompiled due to dependency changes.
This will just be a quick test of a boolean, actual dependency checks
are done by the background thread.

The JSP page compiler will call a method in JspDependency to remove all
dependencies for the current JSP page on compile start, then call an
add method for each compile time include dependency found.

After a JSP page compile has completed any changes to dependencies
are written back out to the JSP_DEPENDENCY.ser file.

Comments or suggestions?



Glenn Nielsen    | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |

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

View raw message