You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by rw...@apache.org on 2004/12/22 05:42:57 UTC
cvs commit: jakarta-jetspeed-2/components/locator/src/java/org/apache/jetspeed/locator JetspeedTemplateDescriptor.java
rwatler 2004/12/21 20:42:57
Modified: portal/src/java/org/apache/jetspeed/velocity
JetspeedVelocityViewServlet.java
components/locator/src/java/org/apache/jetspeed/locator
JetspeedTemplateDescriptor.java
Log:
correct absolute path access and comparison for velocity engine macro configuration
Revision Changes Path
1.15 +5 -5 jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
Index: JetspeedVelocityViewServlet.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- JetspeedVelocityViewServlet.java 18 Dec 2004 15:13:39 -0000 1.14
+++ JetspeedVelocityViewServlet.java 22 Dec 2004 04:42:57 -0000 1.15
@@ -367,7 +367,7 @@
synchronized (velocityEngineCache)
{
// use cached velocity engine if available
- VelocityEngine velocity = (VelocityEngine) velocityEngineCache.get(config.macros.getPath());
+ VelocityEngine velocity = (VelocityEngine) velocityEngineCache.get(config.macros.getAbsolutePath());
if (velocity != null)
{
return velocity;
@@ -480,7 +480,7 @@
if (((macrosDescriptor == null) && (config.macros != null)) ||
((macrosDescriptor != null) && (config.macros == null)) ||
((macrosDescriptor != null) && (config.macros != null) &&
- (!macrosDescriptor.getAbsolutePath().equals(config.macros.getPath()) ||
+ (!macrosDescriptor.getAbsolutePath().equals(config.macros.getAbsolutePath()) ||
(config.macros.lastModified() != config.macrosLastModified))))
{
// set or reset configuration cache entry
@@ -518,7 +518,7 @@
if (!forceVelocityEngineRefresh)
{
// use cached velocity engine
- velocity = (VelocityEngine) velocityEngineCache.get(config.macros.getPath());
+ velocity = (VelocityEngine) velocityEngineCache.get(config.macros.getAbsolutePath());
}
if (velocity == null)
{
@@ -526,7 +526,7 @@
velocity = initVelocity(macrosDescriptor);
if (velocity != null)
{
- velocityEngineCache.put(config.macros.getPath(), velocity);
+ velocityEngineCache.put(config.macros.getAbsolutePath(), velocity);
}
}
}
1.3 +4 -2 jakarta-jetspeed-2/components/locator/src/java/org/apache/jetspeed/locator/JetspeedTemplateDescriptor.java
Index: JetspeedTemplateDescriptor.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/components/locator/src/java/org/apache/jetspeed/locator/JetspeedTemplateDescriptor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JetspeedTemplateDescriptor.java 20 May 2004 16:06:37 -0000 1.2
+++ JetspeedTemplateDescriptor.java 22 Dec 2004 04:42:57 -0000 1.3
@@ -15,6 +15,8 @@
*/
package org.apache.jetspeed.locator;
+import java.io.File;
+
/**
* Jetspeed default Template Descriptor implementation
*
@@ -53,7 +55,7 @@
*/
public void setAbsolutePath(String path)
{
- this.absolutePath = path;
+ this.absolutePath = (new File(path)).getAbsolutePath();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org