Hi,
Using the $link within the context I prepare it with some
PathInfo and QueryData, and then reuse it using remove and
addPathInfo. Example:
## other $link.addPathInfo preceeded
<img src="$link.addPathInfo("images", "image1.gif").URI" />
#set $dummy = $link.removePathInfo("images")
<img src="$link.addPathInfo("images", "image2.gif").URI" />
Since the TemplateLink overrides the DynamicURI.toString() clearing
the PathInfo and QueryData after rendering it to a string, it looses
any presets.
Therefore I propose to add TemplateLink.getURI() to enable
rendering the $link without clearing the PathInfo and QueryData.
I hope that any CVS master can takeover the diff -u from below.
:) Christoph
------------------------- cut here ------------------------
---
Apache-Turbine-20001109/src/java/org/apache/turbine/util/template/TemplateLink.java
Wed Oct 18 19:59:11 2000
+++ Apache-Turbine/src/java/org/apache/turbine/util/template/TemplateLink.java Thu
+Nov 9 17:07:54 2000
@@ -141,7 +141,8 @@
}
/**
- * Returns the URI.
+ * Returns the URI. After rendering the URI, it clears the pathInfo
+ * and QueryString portions of the DynamicURI.
*
* @return A String with the URI in the form
* http://foo.com/Turbine/template/index.wm/hello/world
@@ -157,4 +158,17 @@
return output;
}
+
+ /**
+ * Returns the URI leaving the source intact. Wraps directly to the
+ * <code>DynamicURI.toString</code> method of the superclass
+ * (avoiding the local toString implementation).
+ *
+ * @return A String with the URI in the form
+ * http://foo.com/Turbine/template/index.wm/hello/world
+ */
+ public String getURI()
+ {
+ return super.toString();
+ }
}
------------------------- cut here ------------------------
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]