[Fwd: Support for &amp; as a parameter separator in <c:url>]

Mikolaj Rydzewski <[email protected]>
Newsgroups gmane.comp.jakarta.taglibs.user
Message-ID <[email protected]>
Hi,

Current version of JSTL's standard.jar does not use &amp; as a parameter 
separator in generated URLs (the c:url and c:param tags). There are more 
and more XHTML enabled sites and such behavior makes generated pages not 
valid XML (more information at 
http://www.htmlhelp.com/tools/validator/problems.html#amp).

The patch is very simple, one has to change 
ParamSupport.aggregateParams() method in 
org.apache.taglibs.standard.tag.common.core package to add &amp; instead 
of just &.

Are there any plans to add this funcionality to future releases?

Regards

-- 
Mikolaj Rydzewski <[email protected]>
ParamSupport.java.diff (text/x-patch, 740 B)
--- ParamSupport.java-orig	2006-09-25 12:26:10.000000000 +0200
+++ ParamSupport.java	2006-09-25 12:27:04.000000000 +0200
@@ -157,7 +157,7 @@
 	    for (int i = 0; i < names.size(); i++) {
 		newParams.append(names.get(i) + "=" + values.get(i));
 		if (i < (names.size() - 1))
-		    newParams.append("&");
+		    newParams.append("&amp;");
 	    }
 
 	    // insert these parameters into the URL as appropriate
@@ -167,7 +167,7 @@
 		    return (url + "?" + newParams);
 	        } else {
 		    StringBuffer workingUrl = new StringBuffer(url);
-		    workingUrl.insert(questionMark + 1, (newParams + "&"));
+		    workingUrl.insert(questionMark + 1, (newParams + "&amp;"));
 		    return workingUrl.toString();
 	        }
 	    } else {
smime.p7s (application/x-pkcs7-signature, 3.3 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.