I figured out the problem I was seeing with XSLT stylesheets being cached
off even though they had changed. We are dynamically determining the
stylesheet to display for a specific URL based on various factors, but the
XSLT processor was only looking at the request object to determine if the
resource had changed. In our case, the requested resource was the same, but
the XSL filename was different. I modified the processor to tack on the
name of the XSL processor to the lookup key.
The changes are as follows:
Index: XSLTProcessor.java
===================================================================
RCS file:
/home/cvspublic/xml-cocoon/src/org/apache/cocoon/processor/xslt/XSLTProcesso
r.java,v
retrieving revision 1.6
diff -u -r1.6 XSLTProcessor.java
--- XSLTProcessor.java 2000/02/13 18:29:34 1.6
+++ XSLTProcessor.java 2000/02/14 20:25:35
@@ -158,11 +158,11 @@
try {
Document sheet;
-
- if (this.hasChanged(request)) {
+ String stylesheetKey = Utils.encode(request, true) +
resource.toString();
+ if (this.hasChanged(stylesheetKey)) {
sheet = getDocument(resource);
this.store.hold(resource, sheet);
- this.monitor.watch(Utils.encode(request, true), resource);
+ this.monitor.watch(stylesheetKey, resource);
} else {
Object o = this.store.get(resource);
if (o != null) {
@@ -170,6 +170,7 @@
} else {
sheet = getDocument(resource);
this.store.hold(resource, sheet);
+ this.monitor.watch(stylesheetKey, resource);
}
}
@@ -198,7 +199,7 @@
}
public boolean hasChanged(Object context) {
- return this.monitor.hasChanged(Utils.encode((HttpServletRequest)
context, true));
+ return this.monitor.hasChanged((String)context);
}
public String getStatus() {
|