is there a reason for objecting this proposed patch? It is fully
backwards compatible!
An alternative would be to provide a clone() method, modyfying and
toString()ing a clone, e.g.
<!-- setup the link root ... here ... then using it: -->
<img src="$link.clone.addPathInfo("images", "image1.gif")" />
<img src="$link.clone.addPathInfo("images", "image2.gif")" />
:) Christoph
P.S. Jon, thanks for applying the patches
TemplatePageAttributes.setHttpEquiv and ParameterParser.Hashtable
Christoph Reck wrote:
>
> 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]
--
==============================================================
Deutsches Zentrum fuer Luft- und Raumfahrt (DLR)
Deutsches Fernerkundungs Datenzentrum (DFD)
DLR-DFD, Muenchner Strasse 20, D-82234 Wessling, Germany
============= Currenlty relocated to ESA-ESRIN ===============
ESA ESRIN Tel: +39 06 941 80 589
c/o Christoph Reck (DLR) Fax: +39 06 941 80 512
Via Galileo Galilei mailto:[EMAIL PROTECTED]
I-00044 Frascati (Roma) http://www.dfd.dlr.de
==============================================================
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]